Application.DoCmd.TransferDatabase only works on Application.CurrentDB
To create link in any other database, use DAO or ADOX methods instead of Application methods.
Is possible to use SQL statements instead, to create query on third database, instead of linked table. Works exactly the same, but is different underneath. You would use Create DDL to create something like this: select * from [mydb.mdb].[mytable].
(david)
"Ward" <Ward[ at ]discussions.microsoft.com> wrote in message news:863BC07F-9503-48B1-86C8-D58B9D50A7B8[ at ]microsoft.com...
[Quoted Text] > Hi, > > Ok using a command something like: > > DoCmd.TransferDatabase acLink, "ODBC", _ > strDBConnectionString, _ > acTable, "Authors-sql", "Authors-access", False, False > > > Ok from the above it will transfer from a ODBC database (e.g. SQL) into
the > current database and make a link to the external to the "Authors-sql" in the > remote database (on SQL Server) and call the link "Authors-access". > > Ok how can I do this instead. Make a link to the SQL table but put that into > another MDB file - not the one I have open (CurrentDB). > > Any ideas? > > Thanks, > > Ward >
|