J
jon
Hi,
I've created a module to create link tables to my Oracle database.
The module is very simple as follows:
Public Function CREATE_LINK_TABLE(ODBC_SCHEMA, ODBC_SOURCE_TABLE,
ODBC_LOCAL_TABLE, DSN, UID, PWD)
On Error Resume Next
DoCmd.RunSQL "DROP TABLE " & ODBC_LOCAL_TABLE
DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;DSN=" & DSN & ";UID="
& UID & ";PWD=" & PWD & ";SERVER=myserver", acTable, ODBC_SCHEMA & "." &
ODBC_SOURCE_TABLE, ODBC_LOCAL_TABLE, False, True
End Function
The problem is that I get prompts for primary keys when using it to link to
some tables, is there a way I can also pass the primary key values in this
module, or is there another way of doing it ?
I want to be able to cycle through all the tables in my database and re-link
them, so that I can use either LIVE data or DEMO data.
Hope that makes sense.
Thanks in advance
Jon.
BTW, I'm using Access 2007
I've created a module to create link tables to my Oracle database.
The module is very simple as follows:
Public Function CREATE_LINK_TABLE(ODBC_SCHEMA, ODBC_SOURCE_TABLE,
ODBC_LOCAL_TABLE, DSN, UID, PWD)
On Error Resume Next
DoCmd.RunSQL "DROP TABLE " & ODBC_LOCAL_TABLE
DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;DSN=" & DSN & ";UID="
& UID & ";PWD=" & PWD & ";SERVER=myserver", acTable, ODBC_SCHEMA & "." &
ODBC_SOURCE_TABLE, ODBC_LOCAL_TABLE, False, True
End Function
The problem is that I get prompts for primary keys when using it to link to
some tables, is there a way I can also pass the primary key values in this
module, or is there another way of doing it ?
I want to be able to cycle through all the tables in my database and re-link
them, so that I can use either LIVE data or DEMO data.
Hope that makes sense.
Thanks in advance
Jon.
BTW, I'm using Access 2007