Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    5

    Unanswered: Retrieving DB2 error from an ODBC connection

    Hello,

    I am connecting to a DB2 database via an ODBC connection (within a VB application).
    The only error messages I can get are the ODBC error messages.
    How could I get the actual DB2 error messages?

    Thanks

    Thom

  2. #2
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    It doesnt sound like the connection is being made at all and that there are no db2 errors. I am assuming that you are running on a Windows environment, and if so you can enable the tracing in the odbc connections. If you go to the odbc configuration window you will see a tab that is labled tracing. Enable the tracing there and that will dump all of the odbc comands to a flat file. Try there first.
    Jim
    ------------
    And back to SQL Server....I always find my way home
    View my Linkedin profile

  3. #3
    Join Date
    Aug 2004
    Posts
    5

    Smile

    Thank you for your help.
    Sorry, I wasn't really clear in my previous message.
    I work in a windows environnment.
    I developped a VB program to request a DB2 table via ODBC.
    I do connect and request the table, but my problem is that when I've got an error (because the syntax of the request is not correct for example) I only obtained the odbc error and not the db2 error. I want the db2 error message, which is much more explicit...

    Cheers

    Thom

  4. #4
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    Quote Originally Posted by ThomBFG
    Thank you for your help.
    Sorry, I wasn't really clear in my previous message.
    I work in a windows environnment.
    I developped a VB program to request a DB2 table via ODBC.
    I do connect and request the table, but my problem is that when I've got an error (because the syntax of the request is not correct for example) I only obtained the odbc error and not the db2 error. I want the db2 error message, which is much more explicit...

    Cheers

    Thom
    The only thing that I can suggest is to take the SQL code or db2 commands that you are passing through VB and run them manualy. I know that because you may be using variables or other things in your VB code this may be hard to do but its always best to keep the trouble shooting as simple as posable.
    Jim
    ------------
    And back to SQL Server....I always find my way home
    View my Linkedin profile

Posting Permissions

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