Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    89

    Unanswered: Any way to capture failed SQL transactio in form?

    HI. I've got a "contacts" form in Access with an sql express 2008 table as record source.

    I added a default button in Access to delete the contact currently being viewed.


    if the contact exists as a foreign key in another table, then it is not allowed to be deleted.

    The problem is when I press the delete button adn this is the case, there is no dialogue, or ODBC error or any indication of the problem, and the contact is not deleted.

    How can I trap this error? and why isn't SQL server sending me back an error that the transaction has failed?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what code are you using to issue the SQL to the server?
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2009
    Posts
    89
    I didn't write the code it's just Access's default "RunCommand" - "Delete Record".

    BUT in looking for the code I found a field called "On Error" and it was set to next. I've now set it to Fail and the error message shows :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •