Q: returning #rows appended/updated

M

MarkD

Hi,

Using Access 2000. So, I know Access knows how many rows
were updated/appended, but I don't know how to capture
that count (other than writing down what the dialog box
says). is there a way I can run an update query through
code and have it return the number of rows updated?

Thanks!
-Mark
 
K

Ken Snell

See Help for info on RecordsAffected property. From A2K2 Help:

RecordsAffected Property


Returns the number of records affected by the most recently invoked Execute
method.

Return Values

The return value is a Long from 0 to the number of records affected by the
most recently invoked Execute method on either a Database or QueryDef
object.

Remarks

When you use the Execute method to run an action query from a QueryDef
object, the RecordsAffected property will contain the number of records
deleted, updated, or inserted.

When you use RecordsAffected in an ODBCDirect workspace, it will not return
a useful value from an SQL DROP TABLE action query.
 
V

Van T. Dinh

If you use DAO code to do the update / append, you can use
the RecordsAffected of the Database or QueryDef Object.

Check Access VB Help on the above Property.

HTH
Van T. Dinh
MVP (Access)
 
M

Mark D

-----Original Message-----
If you use DAO code to do the update / append, you can use
the RecordsAffected of the Database or QueryDef Object.

Check Access VB Help on the above Property.

HTH
Van T. Dinh
MVP (Access)



.
 

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