Docmd.RunSql problem

  • Thread starter Thread starter Mohammad
  • Start date Start date
M

Mohammad

I am using DoComd.Runsql to insert rows in a table. There
are some rows not inserted because of key vaulation error.
How can I know if the rows are inserted succeffully or not?
I tried to use Error catching using On Error statement,
but it does not catch the error.
Please, send me the response on e-mail:
(e-mail address removed)
 
Mohammad said:
I am using DoComd.Runsql to insert rows in a table. There
are some rows not inserted because of key vaulation error.
How can I know if the rows are inserted succeffully or not?
I tried to use Error catching using On Error statement,
but it does not catch the error.
Please, send me the response on e-mail:
(e-mail address removed)

If using DAO:

CurrentDb.Execute "INSERT blah blah blah", dbFailOnError

You will then be able to trap the error. If using ADO, I imagine it's
probably something like CurrentProject.Connection.Execute instead of
CurrentDb.Execute
 
Back
Top