LegalizeTheTruth
Programmer
Hello! It might be an easy question for you, but I don't find an answer to it. I have the following code, which works perfectly:
Those variables in the init module are public and defined like this:
dbLogin = "ODBC;DSN=CEPC;UID=MYID;PWD=MYPASS;LANGUAGE=us_english;DATABASE=CEPC"
dbTable = "tbl_prod_mas"
Now that init.useTableName is a name I can give in a form's input text field, representing the name of the target table.
So my question: Is it possible to include a different Database in the Destination parameter? Like this:
Destination:=[Different/Database/Path/TargetDB.accdb].[TargetTable]
...so I don't have to import from ODBC to the current db but to different one.
I could use different approches to this problem, like linking the ODBC table and set a variable for the target DB, then use a sql query like targetDB.Execute "SELECT * INTO TargetTable FROM tbl_linkedODBC", but I'm curious whether it's possible or not.
Thanks people... any help is appreciated.
Code:
DoCmd.TransferDatabase _
TransferType:=acImport, _
DatabaseType:="ODBC Database", _
DatabaseName:=init.dbLogin, _
ObjectType:=acTable, _
Source:=init.dbTable, _
Destination:=init.useTableName
dbLogin = "ODBC;DSN=CEPC;UID=MYID;PWD=MYPASS;LANGUAGE=us_english;DATABASE=CEPC"
dbTable = "tbl_prod_mas"
Now that init.useTableName is a name I can give in a form's input text field, representing the name of the target table.
So my question: Is it possible to include a different Database in the Destination parameter? Like this:
Destination:=[Different/Database/Path/TargetDB.accdb].[TargetTable]
...so I don't have to import from ODBC to the current db but to different one.
I could use different approches to this problem, like linking the ODBC table and set a variable for the target DB, then use a sql query like targetDB.Execute "SELECT * INTO TargetTable FROM tbl_linkedODBC", but I'm curious whether it's possible or not.
Thanks people... any help is appreciated.