PRB: DAO Recordset RecordCount Incorrect When Based on Text File (242478)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q242478 SYMPTOMS
When using the Jet Text ISAM Driver to open a Recordset based on a delimited or fixed width text file, the count returned from the RecordCount property is incorrect.
DAO 3.51 and DAO 3.6 may yield different results, however both are incorrect.
Testing text files with a varying number of rows and types of delimiters yielded the following results: |
Tab-delimited | 17 | 22 | CSV | 20 | 27 | Semicolon delimited | 29 | 42 | Fixed Width | 30 | 32 | Fixed Width | 60 | 65 | Semicolon delimited** | 3 | 3 |
*The RecordCount returned when using DAO 3.6 are different from the values earlier.
**A file with a very small number of rows may return the correct record count. RESOLUTION
If you require an accurate record count of the Recordset, add a user defined counter within a loop, incrementing it by one as you loop through the entire Recordset.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 1/11/2001 |
---|
Keywords: | kbDSupport kbprb KB242478 |
---|
|