counting rows (1 Viewer)

A

autumnf19

Guest
In my code I have a sql command that reads as follows: strSQLCount = "Select Count(*) from TC_TestCase" I then want to determine if there are any rows in the table or not...if there are then open one form and if not then open another form. The problem...once I have that sql statement, how do I use the value that it returns to check if there are rows in the table???
 

D-Fresh

Registered User.
Local time
Today, 06:51
Joined
Jun 6, 2000
Messages
225
Use the following in your variable...

strSQLCount = "Select Count(*) As NumRecs from TC_TestCase"

Then just use NumRecs as your fieldname and that will give you the number...

Just a suggestion... Just open the table, then check for EOF or use the recordcount property. Either of these should be easier to handle. Hope this helps.

Doug
 

Users who are viewing this thread

Top Bottom