If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Retrieving DB2 error from an ODBC connection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-23-04, 09:51
ThomBFG ThomBFG is offline
Registered User
 
Join Date: Aug 2004
Posts: 5
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
Reply With Quote
  #2 (permalink)  
Old 09-23-04, 11:42
JDionne JDionne is offline
Registered User
 
Join Date: Aug 2002
Location: Charlotte NC
Posts: 663
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
Reply With Quote
  #3 (permalink)  
Old 09-23-04, 11:53
ThomBFG ThomBFG is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 09-23-04, 12:05
JDionne JDionne is offline
Registered User
 
Join Date: Aug 2002
Location: Charlotte NC
Posts: 663
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On