TechTalk: How Do I Find ODBC Errors?

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Q: I'm writing an application that uses ODBC from Visual Basic (VB). From time to time, I get an ODBC error, but the messages are always rather vague. For example, I often get a message saying "Error returned by the ODBC driver." However, there's no additional diagnostic information.

I know I can use the ODBC application program interfaces (APIs) to get additional error information, but I'm not using the APIs in my program. It would be somewhat difficult to switch from using the VB data control to using the APIs just to find out more about the error. I'd like to know if there is an easier way to find out what the problem is.

I've tried looking at the history log and the QSYSOPR message queue, but I don't ever see anything regarding the problem I'm having. Is there somewhere else I can look?

A: Every ODBC driver handles errors differently. However, just about every ODBC driver that I know of starts a job on the AS/400. It's that job that handles the requests you make and returns the necessary data.

Depending on your configuration, the job most often runs in the QCMN subsystem. The name may vary depending on how your PC and AS/400 are set up, but it will use the user profile you logged into the ODBC driver with. When you get the error, the job may complete or it may still be running in the subsystem.

You can start with the Work with Active Jobs (WRKACTJOB) command and look at the subsystem where your communication jobs run. Typically, but not always, your display station emulation will show with a function of *-PASSTHRU. Your ODBC job will often not display anything in the function column; you simply need to look for any jobs using your user profile.

If you don't see the job active, you need to start looking for a job log. You may need to make a change so your job produces a job log. You might also look for the job using the Work with User Jobs (WRKUSRJOB) command using your user profile.

Many of the ODBC drivers log more detailed error information into the job log. So, if you can't figure out what's wrong on the client side, give the job log on the AS/400 a try. It might have what you're looking for.

? Jim Hoopes

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: