VB 6 application connecting to ASE 12.5 (NT) using OLEDB/ODBC drivers. Gets
He retrieve rows from the database - WORKS Fine!!!
But as soon as he wants to see how many rows was returned the recordcount
He gets this problem connecting using ODBC and OLEDB.
He gets the recordcount from the recordset object's recordcount property.
This is what I found on the MSDN online manuals:
RecordCount Property - ADO
Indicates the current number of records in a Recordset object.
Use the RecordCount property to find out how many records are in a Recordset
object. The property returns -1 when ADO cannot determine the number of
records. Reading the RecordCount property on a closed Recordset causes an
If the Recordset object supports approximate positioning or bookmarks - that
is, Supports (adApproxPosition) or Supports (adBookmark), respectively,
returns True - this value will be the exact number of records in the
Recordset regardless of whether it has been fully populated. If the
Recordset object does not support approximate positioning, this property may
be a significant drain on resources because all records will have to be
retrieved and counted to return an accurate RecordCount value.
When you work with linked TableDef objects, the RecordCount property setting
is always -1.
According to Microsoft, there are 3 reasons for this problem
1. ADO cannot determine number of records
2. Provider does not support recordcount
3. Cursor type does not support recordcount
ADO works if I query a SQL Server 7 Database
The cursor type is the same for a Sybase and SQL Server query.
The App works against MS Sql Server.
The only differece is the Provider
Here is the link
Use the RecordCount property to find out how many records are in a
Recordset object. The property returns -1 when ADO cannot determine the
number of records or if the provider or cursor type does not support
RecordCount. Reading the RecordCount property on a closed Recordset
causes an error.
Is the problem the OLEDB/ODBC driver or not?