Does anyone know if when I send an update command to an Access database, does Access send any information back to VB to confirm that it has updated the table?
It depends on whether you're using DAO or ADO. With DAO, use the dbFailOnError option and the call will generate a run-time error if, for example, the query can't execute because it would cause a key violation.
With ADO, the call will generate a runtime error if not successful, also you can check the 'RecordsAffected' parameter which is the 2nd parameter for the Execute method.
'DAO style:
Dim db As DAO.Database
'(set db by opening a database)
db.Execute "UPDATE TABLE1 SET NAME='AAA'", dbFailOnError
'OR -- ADO style:
Dim cn As ADODB.Connection
Dim lngRecs As Long
'(set cn by opening a database)
cn.Execute "UPDATE TABLE1 SET NAME='AAA'", lngRecs, adCmdText
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.