How can I import an ODBC table into Access. I know how to link tables,
but I need to know how to import a table directly. I need to do it
without any SQL statement, SLECT INTO. The code below works fine for
linking the table, but how can I modify to import the table????
Public Sub LinkODBCTable()
Dim DB As Database
Dim tdfODBCTable As TableDef
' Open a Microsoft Jet database.
Set DB = OpenDatabase _
("C:\MDBDirectoty.mdb")
' Create a TableDef object.
Set tdfODBCTable = DB.CreateTableDef _
("TableDefName")
' Set the connection information.
tdfODBCTable.Connect = _
"ODBC;DATABASE=;UID=;PWD=;DSN="
tdfODBCTable.SourceTableName = "ODBC_TABLE_NAME"
' Append the TableDef object to create the link.
DB.TableDefs.Append tdfODBCTable
End Sub
Thanks for any help
-John-