• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1078
  • Last Modified:

AS-400 ODBC driver

As part of our project, a VB6 application from Oracle/AIX setup has to update data in DB2/400 on AS/400.
I would like to know :
Is it possible to have an ODBC connection to DB2/400 ?
Where I can get the driver and how to do the configuration?

Please reply in detail, Thanks in advance.
  • 2
  • 2
1 Solution
Addressing your questions in order:

>Is it possible to have an ODBC connection to DB2/400 ?

Yes it is. For instance IBM´s Visual Age for Java, Enterprise editions comes with an ODBC driver for DB2. Aditionaly, Visual Ages Toolkit 400 comes with several alternatives to access a Database on the AS400, most via Client Access. (although this second aspect is only interesting in your case since you are looking for VB solutions).

Although I don´t know this for a fact, I would assume that Visual Age for C++ Enterprise Edition  

should contain such a driver and would be a better tool for a VB6 developer.

>Where I can get the driver and how to do the configuration?

As to where to get the driver, the obvious first choice is dirrect from IBM. another driver vendor you may want to look at is Inprise, at:


As to configuration, that depends on the actual driver you purchase. Some older drivers used Novel or OS/2 as gateways and depended heavily on network configurations. Others, thar rely on client access will be esier to configure but rather slow. Driver that run over Toolkit 400 are faster but harder to get running properly.

IBM's ODBC driver establishes the connection over TCP/IP although they report they will be (or have) be changing to livewire in the near future.

Ron WarshawskyCommented:

  Jpk provided you with some information. However I do have a better answer with the detailed instructions on getting right software from IBM and establishing connection to AS-400.


I have only installed and used java on an AS400 once, and that was with SQL400, not DB2. If you have a better answer then by al means post it :-)

Im withdrawing my answer to the comment level. Post your answer and let ajit11 choose whats best.
Ron WarshawskyCommented:

  Thanks for letting me post answer on this question.


Here are the necessary steps to establish ODBC connection to DB2.

1. Download from IBM site (or use CD if you have one) DB2 connect personal edition. It can be found at http://www-4.ibm.com/software/data/db2/udb/downloads.html.

2. Install DB2 Connect personal edition on the client machine.

3. After installation run Client Configuration Assistant (CCA) application (found in the DB2 for Windows 98/NT folder)

4. Add a AS/400 database to your system

Step 1.
  Select Manually configure a connection to a DB2 database radio button and click on the Next push button

Step  2.
 Select the radio button that corresponds to the location where you would like your DB2 directories to be maintained.

Step  3.
 Select the radio button that corresponds to the protocol that you want to use from the Protocol list (I assume you using TCP/IP) and click on the Next push button.

Step  4.
 Enter the required communication protocol parameters and click on the Next push button. For more information, click on the Help push button.
Step  5.
 Enter the database alias name of the remote database that you want to add in the Database name field and a local database alias name in the Database alias field. Add a comment that describes this database in the Comment field and click on the Next push button.

If you are adding a database that resides on a AS/400 system, the Database name field will appear as follows:  
AS/400 RDB name

Step  6.
 Register this database as an ODBC data source.

Ensure that the Register this database for ODBC check box is selected.

Select the radio button that describes how you would like to register this database:

If you would like all users on your system to have access to this data source, select the As a system data source radio button.

If you would like only the current user to have access to this data source, select the As a user data source radio button.

If you would like to create an ODBC data source file to share database access, select the Create a file data source check box and enter the path and filename for this file in the File data source name field.

Click on the Optimize for application drop down box and select the application for which you want to tune the ODBC settings.

Click on the Done push button to add the database that you selected. The Confirmation window opens.

You can also select the Node Options tab, the Security Options tab, or the Host or AS/400 Options tab (if you are adding a host or AS/400 database) to specify more detailed catalog information.

Step  7.
 Click on the Test Connection push button to test the connection. The Connect to DB2 Database window opens.

Step  8.
 Enter your user ID and password and click on OK. If the connection is successful, a message confirming the connection appears.
Step  9.
 You are now able to use this database. To finish using the Add Database SmartGuide, click on the Close push button; you can then add more databases by clicking on the Add push button or exit the CCA.

  When you have finished adding the host or AS/400 database to your system, it is recommended to bind any DB2 utilities or applications to the database you just added by performing the following steps:

Step  1.
 Log on to the system with a user ID that has System Administrative (SYSADM), Database Administrative (DBADM), or Bind Add (BINDADD) authority on the database.
Step  2.
 Start the CCA.
Step  3.
 Select the database that you want to bind the utilities and packages against.
Step  4.
 Click on the Bind push button.
Step  5.
 Select the type of bind that you want to perform:

Select the Bind DB2 utilities radio button if you want to bind utilities against the database

Select the Bind applications radio button if you want to bind applications against the database
Step  6.
 Click on the Continue push button.
Step  7.
 Enter a user ID and password to connect to the database.
Step  8.
 Select the utilities or applications that you want to bind and click on OK.

Please, let me know, if you have any installation questions or server side configuration details.


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now