BUG: RDO Rowcount May Be Wrong When Using rdAsyncEnable FlagLast reviewed: October 17, 1996Article ID: Q151815 |
The information in this article applies to:
SYMPTOMSWhen using rdoResultsets, the RowCount property is useful for determining how many records have been returned by the query. Depending on the driver and data source, the RowCount property returns either -1 to indicate that the number of rows is not available, or 0 to indicate that no rows were returned by the rdoResultset. If the driver is capable of returning a row count, the RowCount property returns the number of rows in the rdoResultset. When opening an rdoResultset using the rdAsyncEnable flag, the RowCount will always return 0. This could lead to the mistaken assumption that the query returned no records.
WORKAROUNDIf a Movelast is executed against the rdResultset before the RowCount is queried, then the RowCount will be correctly set. If the rdAsyncEnable flag is not passed to OpenResultset, the problem does not occur.
STATUSMicrosoft has confirmed this to be an issue in the Microsoft products listed at the beginning of this article. Microsoft is researching this issue and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe following Visual Basic code opens a connection to the server and creates an asynchronous rdoResultset. This code uses a "DSN-less" ODBC connection so you do not need to set up a DSN (Data Source Name) with the ODBC Admin utility. For more details on doing this DSN-less connection, see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q147875 Title : How to Use DSN-Less ODBC Connections with RDO and DAOIn the following code, MyServer is assumed to be a Microsoft SQL Server with the default database PUBS installed.
Steps to Reproduce Problem
REFERENCESVisual Basic Online Help OpenResultset, RowCount
|
Additional reference words: 4.00 vb4win vb432
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |