Microsoft KB Archive/169445: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 80: | Line 80: | ||
<li>Open Nwind.mdb.</li> | <li>Open Nwind.mdb.</li> | ||
<li><p>Enter the following SQL statement:</p> | <li><p>Enter the following SQL statement:</p> | ||
<pre class="codesample"> select * from customers where customers.customerid like | <pre class="codesample"> select * from customers where customers.customerid like "*" | ||
</pre></li> | </pre></li> | ||
<li>Execute the statement and note that VisData will report two records being returned.</li></ol> | <li>Execute the statement and note that VisData will report two records being returned.</li></ol> |
Latest revision as of 11:04, 21 July 2020
Article ID: 169445
Article Last Modified on 4/18/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Enterprise Edition
This article was previously published under Q169445
SYMPTOMS
When entering SQL statements in Visual Basic 5.0 Visual Data Manager (VisData), the record count may be incorrect. The same SQL statement entered in Visual Basic 4.0 Data Manager will return the correct number of records.
CAUSE
All records do appear in some circumstances, such as with the DBGrid control, Data Manager, etc., because in these circumstances all records need to be retrieved to be displayed to the user, in which case there is no need to explicitly call MoveLast.
RESOLUTION
Always go the last record in VisData or issue a MoveLast of a recordset variable in order to get the correct record count using the DBGrid.
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
Within VisData:
- Open Nwind.mdb.
Enter the following SQL statement:
select * from customers where customers.customerid like "*"
- Execute the statement and note that VisData will report two records being returned.
In Visual Basic 4.0 Data Manager:
- Open Nwind.mdb.
- Enter the same SQL Statement and note that Data Manager returns 91 records.
REFERENCES
For additional information, please see the following article in the Microsoft Knowledge Base:
109053 PRB: Using RecordCount with VB Dynasets, Snapshots, and Tables
Keywords: kbprb KB169445