Consulting

Results 1 to 6 of 6

Thread: Access not catching oracle errors

  1. #1

    Access not catching oracle errors

    I have an MS Access database that connects to Oracle using an ADO connection. The connection is fine when the user inputs the correct username/password but when they don't Oracle throws up an error and I can't seem to figure out how to handle it in Access. This happens for any error that happens on Oracle but I'll settle for just handling the login error. Has anyone seen something similar and/or know how to code it so that Oracle errors are handled by Access?

  2. #2
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    The ADO Connection Object has an Errors Collection. You would want to set up your code to interrogate this Collection then respond appropriately based on the error description or one of the other properties. The following link may be appropriate to your situation:

    http://www.devx.com/tips/Tip/13483

    Stan

  3. #3
    thx for the info stan. this seems highly related to my problem but i'm still not sure how to handle/catch it. I have an "on error goto errorHandler" before i open the connection but when it executes it doesn't catch it. is there another way to handle/catch these types of errors?

  4. #4
    I figured out the problem, or rather my colleague did. The problem was that the VBA editor was set to break on all error rather than being set to break only on unhandled errors. I'm not quite sure why this fixes my problem but it did.

  5. #5
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    Quote Originally Posted by avgnick
    The problem was that the VBA editor was set to break on all error rather than being set to break only on unhandled errors.
    Not really sure what this means myself, but glad your problem is solved. My personal experience with connecting to Oracle through Access involved having a 'user' table to hold name and pw, then track login and disconnect dates/times. This eliminated Oracle errors because the user/pw were validated within Access, then the correct connection string was sent to Oracle.

    Probably one of the head OPS will ask you to mark this as solved. Stan

  6. #6
    VBAX Contributor moa's Avatar
    Joined
    Nov 2006
    Posts
    177
    Location
    Quote Originally Posted by stanl
    Not really sure what this means myself, but glad your problem is solved.
    It's one of VBAs General Options. Quite good for testing/run-throughs after your own error catching is in place.
    Last edited by moa; 03-26-2007 at 06:18 AM.
    Glen

Posting Permissions

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