Select Count(*) Returns 0 (1 Viewer)

WayneRyan

AWF VIP
Local time
Today, 08:18
Joined
Nov 19, 2002
Messages
7,122
Hello,

I have an Access Front-End utility that simply fills tables with BCP data and
counts the rows. It has worked forever with no problems.


sql = "Select Count(*) As HowMany From " & RTrim(Me.TableName)
rst.Open sql, DbConnection
RowsFound = rst!HowMany

In this one particular database, the Count(*) returns a 0 on about a fourth of
the tables.

If I change it to "Count(0)" or "Count([SomeField])", it works fine.

My question is: Under what circumstances does "Select Count(*) From MyTable" return a 0?

Pasting the SQL into the Query Analyzer returns the proper number.
Pointing the DbConnection to another database works fine.

Is it some weird ADO quirk?
Microsoft Access 2007 Front-End & SQL Server 2000.

Yes, the BCP operation is a Shell-And-Wait.

Thanks,
Wayne
 

Users who are viewing this thread

Top Bottom