• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 778
  • Last Modified:

what error numbers will CurrentDb.Execute strSQL,dbFailOnError raise?

hey guys,

i'm trying to write an error handler for the rollback of a transaction and instead of writing a generic catch everything error handler, i would like to handle specific errors that will be raised by dbFailOnError.

hrmm from what i read there could be a few / a myriad of errors raised.

does anyone have the list of errors that dbFailOnError could raise?

if not, could you advise me how i can handle the error specifically? thanks guys!! = ))
2 Solutions
Rey Obrero (Capricorn1)Commented:
the dbFailOnError option generates a run-time error and rolls back all successful changes if any of the records affected are locked and can't be updated or deleted.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"there could be a few / a myriad of errors raised."

"does anyone have the list of errors that dbFailOnError could raise?"
Doubtful - because there are sooooo many possibilities.

However, there is good news. Depending on exactly what you are doing - for example - executing an Update query - one error you would want to trap for sure are is Write Conflict error (there are a couple) ... so, for a given situation, you do not need to cover 'everything' - IE,  errors that might occur for a delete execute - might occur for an Append execute.

developingprogrammerAuthor Commented:
thanks capricorn1! yup the availability of locks is very important in dbFailOnError! = )

ah i see, thanks mx! definitely agree with you that we can try to gear ourselves for the main errors. hrmm, but i think what i'll do is create a sub function for this if it's very critical so i know that all errors raised in the sub function is a result of the things inside the transaction. thanks mx!! = ))
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now