Results 1 to 6 of 6

Thread: Empty Recordset [Resolved]

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2003
    Location
    Georgia
    Posts
    32

    Empty Recordset [Resolved]

    I added a record to the table and I am still getting empty recordset. I have two tables:

    tblClassification - id, classification
    tblSnipplets - id, dateadded, classification, code, title

    I am getting the following error:
    Run-Time Error '3021'. Either BOF or EOF is True, or the current record has been deleted.


    Code:
    Private Sub initializeTree()
    
    tvwItems.ImageList = imgList
        
        Dim nodClass As Node
        Dim nodTitle As Node
        
        tvwItems.LineStyle = tvwRootLines
        tvwItems.Nodes.Clear
        
        'Opens the recordset for Class
        Set rsClass = New ADODB.Recordset
        strSQLClass = "SELECT id, classification FROM tblClassification ORDER BY classification"
        rsClass.Open strSQLClass, conTree, adOpenStatic, adLockOptimistic
        
        'set node for treeview
        If rsClass.RecordCount > 0 Then
            While Not rsClass.EOF
                Set nodClass = tvwItems.Nodes.Add(, , (rsClass.Fields("classification")), (rsClass.Fields("classification")), 1)
                rsClass.MoveNext
                DoEvents
            Wend
        End If
        
        'Opens the recordset for Title
        Set rsTitle = New ADODB.Recordset
        strSQLTitle = "SELECT title, classification, code, dateadded FROM tblSnipplets WHERE classification LIKE '" & (rsClass.Fields("classification")) & "%'"
        rsTitle.Open strSQLTitle, conTree, adOpenStatic, adLockOptimistic
        
        'set node for treeview
        If rsTitle.RecordCount > 0 Then
            While Not rsTitle.EOF
                Set nodTitle = tvwItems.Nodes.Add((rsClass.Fields("classification")), tvwChild, (rsTitle.Fields("title")), (rsTitle.Fields("title")), 2)
                rsTitle.MoveNext
                DoEvents
            Wend
        End If
        
    End Sub
    Last edited by odamsr; Apr 6th, 2004 at 04:44 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width