1. You need to set recordset CursorLocation to client first.
Code:
Dim RST As ADODB.Recordset
Set RST = New ADODB.Recordset
rst.CursorLocation = adUseClient
2. Not every data provider supports the record count.
i got a trouble.
pls help me again.
here is the code i've entered.
Code:
Private Sub Command1_Click()
Set rec = New ADODB.Recordset
rec.CursorLocation = adUseClient
'to see how many records in the table
Text1.Text = rec.CursorLocation
MSFlexGrid1.TextMatrix(1, 0) = rec.Fields(0)
End Sub
then the attachment is the screen shot of the error.
the error is in the rec.fields (0) and said that:
Item cannot be found in the collection corresponding to the requested name or ordinal.
Last edited by macmatira; May 17th, 2011 at 01:15 PM.
Reason: additional information. (ellaboration)
the error is in the rec.fields (0) and said that:
Item cannot be found in the collection corresponding to the requested name or ordinal.
You are not selecting any records - if you do then at least it's not presented here.
There must some kind of "Select * From..." sql staement executed.
If you are beginner to database programming I would recommend checking out Database FAQ section for lots tutorials, tips and sample code.