K
Kim
I am using the following code to connect to Oracle tables DNSless. The
problem is that I receiving a "runtime error 3146" when the code reaches
tdf.Connect = strConnect. Any hep would be appeciated.
Function ConnectODBC()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim strConnect As String
strConnect = "ODBC;DRIVER={Microsoft ODBC for Oracle}" _
& ";DATABASE=" & strDatabase _
& ";UID=" & strUID _
& ";PWD=" & strPWD & ";"
Set db = CurrentDb()
Set tdf = db.CreateTableDef("tblName")
tdf.SourceTableName = "OracletblName"
tdf.Connect = strConnect
db.TableDefs.Append tdf
db.TableDefs.Refresh
Set tdf = Nothing
Set db = Nothing
End Function
TIA,
Kim
problem is that I receiving a "runtime error 3146" when the code reaches
tdf.Connect = strConnect. Any hep would be appeciated.
Function ConnectODBC()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim strConnect As String
strConnect = "ODBC;DRIVER={Microsoft ODBC for Oracle}" _
& ";DATABASE=" & strDatabase _
& ";UID=" & strUID _
& ";PWD=" & strPWD & ";"
Set db = CurrentDb()
Set tdf = db.CreateTableDef("tblName")
tdf.SourceTableName = "OracletblName"
tdf.Connect = strConnect
db.TableDefs.Append tdf
db.TableDefs.Refresh
Set tdf = Nothing
Set db = Nothing
End Function
TIA,
Kim