Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODC recordcount

Status
Not open for further replies.

sankur

Programmer
Jul 10, 2002
8
hi all
i'm using ado data control to link to a database. I need to display the number of records in a label using the recordcount property. However when i run my form, it displays record 2 as the first record. the position of the first record is taken by record -1(negative) which is blank and is not in my database. The same also happens with the last record, position is -2 and is also blank and also doesn't exist in my database. can anyone help. here is my code:

Private Sub cmdFirst_Click()
If adoSales.Recordset.EOF Then
MsgBox "You have reached the first record", vbCritical
Else
adoSales.Recordset.MoveFirst
lblCurrent.Caption = adoSales.Recordset.AbsolutePosition + 1
lblAll.Caption = adoSales.Recordset.RecordCount
End If
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top