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 > Connect from Excel to DB using ODBC

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Aug 2010
Posts: 14
Connect from Excel to DB using ODBC


Please let me know how to connect to database from Excel using ODBC connection.
Reply With Quote
  #2 (permalink)  
Registered User
Join Date: Apr 2012
Posts: 635
Always post your DB2-Version and fixpack, and operating-system version.

The precise way to do it varies slightly between different versions of Excel, and different client packages of DB2. You gave no details of either. Depending on which verison of Excel, some default installations on older versions of Office do not include MS Query, but modern 2010 Office versions do include it. Otherwise you might need to install additional components of MS Office.

Is all your software installed (DB2 client ?, Excel additional options for external data sources?). If not, then fix that problem first.

First learn how to catalog your db2 databases as ODBC data sources. This you can you with DB2 facilities. For example one way is to study this:
CATALOG ODBC DATA SOURCE - IBM DB2 9.7 for Linux, UNIX, and Windows

After your ODBC data source is catalogued, then use odbcad32 GUI to tell Windows about it. In other words you use odbcad32 to add either a 'System DSN' for your db2 database, or a 'User DSN'. With this tool you can also test that the ODBC connection is working correctly ('Test Connection').

Finally, depending on your version of Excel, you can access 'external data'. Example in Excel-2010: Data-->From Other Sources-->From Microsoft Query. In the 'Choose Data Source' window, you should see your already catalogued System-DSN (from the previous step made by odbcad32), so choose that one then navigate from there...
Reply With Quote

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