Hello
I am trying to connect to DB2 Z/Os from Excel VBA and was successfull in connecting until my Hard Drive was replaced. Now when I try to connect it says
Error: Method 'Open' of object '_Connection' failed.
I tried the same code from my friends PC and it works fine there.
In my references I have the following checked
Visual Basic For Applications
Microsoft Excel 10.0 Object Library
Msft ActiveX Data Objects 2.7 Library
OLE Automation
Msft ActiveX Data Objects (Multi-dimensional) 2.7 Library
and here is my code
Dim ObjCnn As New Connection
ObjCnn.ConnectionString = "DSN=DB2DSNS;User ID=" & userid & ";PWD=" & pswd & ";"
ObjCnn.ConnectionTimeout = 600
ObjCnn.CursorLocation = adUseClient
ObjCnn.Open
I tried connecting to the DSN directly from ODBC and it works perfectly fine.
Any help to solve the problem is appreciated.
I am trying to connect to DB2 Z/Os from Excel VBA and was successfull in connecting until my Hard Drive was replaced. Now when I try to connect it says
Error: Method 'Open' of object '_Connection' failed.
I tried the same code from my friends PC and it works fine there.
In my references I have the following checked
Visual Basic For Applications
Microsoft Excel 10.0 Object Library
Msft ActiveX Data Objects 2.7 Library
OLE Automation
Msft ActiveX Data Objects (Multi-dimensional) 2.7 Library
and here is my code
Dim ObjCnn As New Connection
ObjCnn.ConnectionString = "DSN=DB2DSNS;User ID=" & userid & ";PWD=" & pswd & ";"
ObjCnn.ConnectionTimeout = 600
ObjCnn.CursorLocation = adUseClient
ObjCnn.Open
I tried connecting to the DSN directly from ODBC and it works perfectly fine.
Any help to solve the problem is appreciated.