Function booklvwRec(str As String)
Dim rs As New ADODB.Recordset
catlvw.ListItems.Clear
rs.Open str, connect, 2, 3 (this section has an error, what is the error in this section) and the error state that: "the connection cannot be used to perform this operation. it is either closed or invalid in this connection"
While Not rs.EOF
With catlvw.ListItems.Add(, , rs!book)
With .ListSubItems
.Add , , rs!author
.Add , , rs!acc
.Add , , rs!Call
.Add , , rs!tbltransactions
End With
rs.MoveNext
End With
Wend
End Function
junjun61991
0
Newbie Poster
Recommended Answers
Jump to Postrs.Open str, connect, 2, 3
Connect seems to be your problem. Firstly, is your function private or public?
You have the rs.Open part correct but no reference to "str", which will be the sql string. This should be something like
Dim str as String str = …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.