Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - report control_ADO
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

report control_ADO

 Post Reply Post Reply
Author
Message
nunggum View Drop Down
Newbie
Newbie
Avatar

Joined: 18 October 2004
Location: Korea, South
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote nunggum Quote  Post ReplyReply Direct Link To This Post Topic: report control_ADO
    Posted: 18 October 2004 at 4:36am

hi.

Error Message in MFC42.DLL Apprears When update Database to Report Control using ADO,
Small DB can update to Report control but Big DB  (16,000 Records) Can't update.

Private db As New ADODB.Connection
Private rs As New ADODB.Recordset
Const COLUMN_PART = 0
Const COLUMN_CODE = 1
Const COLUMN_PAPER_SIZE = 2
Const COLUMN_SIZE = 3
Const COLUMN_PRINTER = 4
Private Sub Form_Load()
sSql = "SELECT * FROM sheet2 ;"
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\any1.mdb;Persist Security Info=False"
rs.Open sSql, db, adOpenStatic, adLockReadOnly
   While Not rs.EOF
      rs.MoveNext
   Wend
   If rs.RecordCount = 0 Then
      Set db = Nothing
   Set rs = Nothing
      RC1.Redraw
    Exit Sub
   End If
rs.MoveFirst
    With RC1.Columns
        .Add COLUMN_PART, "part1", 50, True
        .Add COLUMN_CODE, "part2", 50, True
        .Add COLUMN_PAPER_SIZE, "part3", 50, True
        .Add COLUMN_SIZE, "part4", 50, True
        .Add COLUMN_PRINTER, "part5", 50, True
    End With
Dim i As Long, Record As ReportRecord, Item As ReportRecordItem, str As String
i = 0
While Not rs.EOF
Set Record = RC1.Records.Add
    Set Item = Record.AddItem(i)
        Item.Value = rs(1)
        Item.Icon = 0
    Set Item = Record.AddItem(i)
        Item.Value = rs(2)
        Item.Icon = 1
    Set Item = Record.AddItem(i)
        Item.Value = rs(3)
    Set Item = Record.AddItem(i)
        Item.Value = rs(4)
    Set Item = Record.AddItem(i)
        Item.Value = rs(5)
        rs.MoveNext
    i = i + 1
Wend
    RC1.SetImageList Me.ImageList1
    RC1.PaintManager.ColumnStyle = xtpColumnFlat
    RC1.Populate
End Sub

Back to Top
dlord View Drop Down
Newbie
Newbie


Joined: 25 October 2004
Location: United States
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote dlord Quote  Post ReplyReply Direct Link To This Post Posted: 02 December 2004 at 9:54pm
Is there an update on this..? My db is approaching this size.
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 03 December 2004 at 6:42am
There isn't a problem with the size of the database, the problem is with "NULL" values.

Here is the necessary modifications to make this code work.


While Not rs.EOF
Set Record = RC1.Records.Add
Set Item = Record.AddItem(0)
    Item.Value = rs(0)
    Item.Icon = 0
  Set Item = Record.AddItem(0)
    Item.Value = IIf(IsNull(rs(1).Value), "Null", rs(1))
    Item.Icon = 1
  Set Item = Record.AddItem(0)
    Item.Value = IIf(IsNull(rs(2).Value), "Null", rs(2))
  Set Item = Record.AddItem(0)
    Item.Value = IIf(IsNull(rs(3).Value), "Null", rs(3))
  Set Item = Record.AddItem(0)
    Item.Value = IIf(IsNull(rs(4).Value), "Null", rs(4))
    rs.MoveNext
    i = i + 1
Wend

Back to Top
dlord View Drop Down
Newbie
Newbie


Joined: 25 October 2004
Location: United States
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote dlord Quote  Post ReplyReply Direct Link To This Post Posted: 03 December 2004 at 11:03pm

thanks

You're right, the nulls will get you. I tested 30,000 records into one report today. 14 columns. It worked with no problems. Well, the only thing was it's slows a bit as the memory swells. which is all expected. Good tool.

dlord

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.