Constraint/Index violation does not throw error

  • Thread starter Jonathan Scott via AccessMonster.com
  • Start date
J

Jonathan Scott via AccessMonster.com

I am inserting rows from other tables into a table that has various
constraints/indexes. When one of them is violated (say trying to put a null
value into a not null field) I find that Access97 drops the row... and
merrily continues on its way. I find that the original number of rows and the
number of rows inserted are not the same.

Is it possible to make Access97 throw an error so that my transaction can
rollback safely?

Jonathan Scott
 
A

Allen Browne

How are you adding the rows?

If you are using an append query, try executing with dbFailOnError:
db.Execute "MyAppendQuery", dbFailOnError

That should cause a trappable error, and you can roll the transaction back.
 
J

Jonathan Scott via AccessMonster.com

Thanks Allen,

I was doing INSERT through execute(). This made it fail correctly. Now, if
only I could prove the reason it is failing. lol. I am getting an error
message, in Japanese, which basically comes to "Could not call DLL". In this
case, I get the feeling DLL does not stand for Dynamically Linked Library.
Would be nice if it could tell me what violation actually triggered the error.


Thanks again,
Jonathan Scott
 

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