Results 1 to 2 of 2
05-29-12, 00:03 #1Registered User
- Join Date
- Aug 2010
Connect from Excel to DB using ODBC
Please let me know how to connect to database from Excel using ODBC connection.
05-29-12, 02:05 #2Registered User
- Join Date
- Apr 2012
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...