PDA

Click to See Complete Forum and Search --> : Recordcount property of ADO


Spooked
Jun 14th, 2000, 08:00 PM
After setting a new recordset in ADO, I am attempting to find out how many records are in it by using the RecordCount property. Things haven't turned out as expected and after using a breakpoint in the code I discovered that the RecordCount value was set to -1.

Looking up MSDN Library, I have found that this value is set when the number of records cannot be determined. Does anyone have any ideas or likely scenarios that would lead to this.

The recordset is definitely open and according to MSDN Library, an error message would occur if it was closed. Why would the RecordCount property not be returned?

lenin
Jun 14th, 2000, 08:52 PM
This is related to the cursor type. The default is forward only. you need to change this when opening the recordset to any other type which supports record count.

HTH

Lenin

Spooked
Jun 14th, 2000, 09:10 PM
Thanks, solved the problem