Linking ODBC table programmatically

jackyccc

New member
Local time
Today, 11:06
Joined
May 2, 2008
Messages
3
HI all, i'm trying to link an ODBC table into MS Access programmatically by using the following VBA code. But it gives me the error message "Could not find installable ISAM." Can anyone please help me out? Thanks..


DoCmd.TransferDatabase acLink, "ODBC Database", "driver={IBM DB2 ODBC DRIVER};DBALIAS=DB2;UID=username;PWD=password", acTable, "ISO47.UAT00000", "Linked_ISO47_UAT00000"
 
I don't have access to DB2 so I can't tell if your connection string is correct. I would link the table manually and then open the MSysObjects table and copy the connection string to be sure it was typed correctly.
 
This is the connection string (according to the Connection Strings website
http://www.connectionstrings.com/?carrier=ibmdb2 )

Code:
Driver={IBM DB2 ODBC DRIVER};Database=myDataBase;Hostname=myServerAddress;Port=1234;Protocol=TCPIP;Uid=myUsername;Pwd=myPassword;
 

Users who are viewing this thread

Back
Top Bottom