I try to create a linked table pointing to Oracle. To make it simple, I "stole" the connection string from a manually created linked table that is working well. The code breaks in the Append, where indicated below. Any clue ? Thanks !
Sub CreaOra()
Dim db As DAO.Database
Dim td As DAO.TableDef
Dim strConn As String
Set db = CurrentDb
'connection string copied from a working linked table !'
strConn = "ODBC;DRIVER={Oracle in OraClient10g_home1};SERVER=ORAJJJ0;UID=xxx;PWD=yyy;DBQ=ORAWOD0;"
Set td = db.CreateTableDef(Name:="test", SourceTableName:="ORAJJJC01.TBL_MYTBL", Connect:=strConn)
'next row -> error 3264 No field defined--cannot append TableDef or Index
db.TableDefs.Append td
Set td = Nothing
Set db = Nothing
End Sub