Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT (*) Question

Status
Not open for further replies.

Swi

Programmer
Feb 4, 2002
1,963
0
36
US
I am using the following code to get the count from a DBF file using VB6 and ADO:


Code:
With rs
    .Open "SELECT COUNT(*) FROM [" & FileName & "]", conn, adOpenStatic, adLockReadOnly, adCmdText
    NumOfRecords = .Fields(0).Value
    .Close
End With

It seems to return the correct count when the DBF is small but if it is large it does not return the correct number. Any ideas? Thanks.

Swi
 
Have you a TRIM() function in your index or any variiant of TRIM (RTRIM(),ALLTRIM())

If so, this is a problem, as the index depth is only that of the trimmed first record
 
I don't think so but I will check.

Swi
 
I checked and there is no function on the index. Any other ideas? Thanks.

Swi
 
Swi,

If you just doing a count, why open the index? Try it without the index and see if you get the same result.
 
Can you provide an example using ADO?

Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top