Cannot Link to UDB DB2 programatically


M

mrudang

Hi,

I am unable to link to a udb database from VBA. I get a error message
saying "Reserved error (-7778); there is no message for this error"
when I try to perform an append to the TableDefs.

I referred to
"http://support.microsoft.com/default.aspx?scid=kb;EN-US;892490" to
write my code.

----------------------------------------

Dim td As TableDef
Dim stConnect As String
Dim db As DAO.Database
Set db = CurrentDb

stConnect = "ODBC;DRIVER=IBM DB2 ODBC
DRIVER;HOSTNAME=zeck10;DATABASE=cms;UID=abc;PWD=123;"

Set td = db.CreateTableDef("Products", dbAttachSavePWD, "abc.Products",
stConnect)

Debug.Print td.Name 'just for the heck/debugging

db.TableDefs.Append td '<---- error

------------------------------------------

I am very very clueless, on wats wrong. This is my 1st shot at writing
VBA code. Please help!

Thanks!
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top