Hi there. I'm trying to make a DSN less connection to a table in DB/2. I'm using Access 97, and the IBM client access ODBC driver for this. I want to do it this way because otherwise I'd have to add a DSN on all machines.
This is my code to link the table:
Upon the line where the table would be appended, I get error -2147467259 (80004005). Undefined error. I've looked all over the web, and seen many explanations for this error, ranging from invalid chracters in the base table name, to the fact that it is read only... None of the suggestions I found helped; Anyone got any clue perhaps?
--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
This is my code to link the table:
Code:
Dim oCat As ADOX.Catalog
Dim oTable As ADOX.Table
Dim sConnString As String
' Set SQL Server connection string used in linked table.
sConnString = "ODBC;" & _
"Driver={Client Access ODBC Driver (32-bit)}; " & _
"System={AS400}; uid=xxx; pwd=xxx"
' Create and open an ADOX connection to Access databased
Set oCat = New ADOX.Catalog
oCat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=D:\shared\sharefiles\KAL.mdb"
' Create a new Table object
Set oTable = New ADOX.Table
With oTable
.Name = "test2"
Set .ParentCatalog = oCat
.Properties("Jet OLEDB:Create Link") = True
.Properties("Jet OLEDB:Remote Table Name") = "LEMDTA.PRSKAL"
.Properties("Jet OLEDB:Cache Link Name/Password") = False
.Properties("Jet OLEDB:Link Provider String") = sConnString
End With
' Add Table object to database
oCat.Tables.Append oTable
oCat.Tables.Refresh
Set oCat = Nothing
Upon the line where the table would be appended, I get error -2147467259 (80004005). Undefined error. I've looked all over the web, and seen many explanations for this error, ranging from invalid chracters in the base table name, to the fact that it is read only... None of the suggestions I found helped; Anyone got any clue perhaps?
--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.