Docmd.RunSql problem

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)
 
B

Brian

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
 

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