Record count of db.execute result

S

Samantha

Hi,
How can I know the record count of the result from sql:
db.Execute str1, dbFailOnError

I want to execute an INSERT query in a loop, as long as there is result.
Is this possible?
Thanks in advance.
 
D

Dirk Goldgar

Samantha said:
Hi,
How can I know the record count of the result from sql:
db.Execute str1, dbFailOnError

I want to execute an INSERT query in a loop, as long as there is
result. Is this possible?
Thanks in advance.

Interrogate the RecordsAffected property of the database object you used
to execute the SQL statement; e.g,

Do
str1 = ...
db.Execute str1, dbFailOnError
Loop Until db.RecordsAffected = 0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top