Is there a way to create SQL link in Access using VBA?
Printable View
Is there a way to create SQL link in Access using VBA?
Yes just right click in access db and select data links ... then use a sql provider and specify the destination.Quote:
Originally posted by Liquid Metal
Is there a way to create SQL link in Access?
I know how to do that. I was referring to do it with VBA.
Here is the solution.
Code:DoCmd.RunSQL ("DROP TABLE TestTable1")
DoCmd.SetWarnings False
DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;DSN=LocalServer;DATABASE=Test", acTable, "Table1", "TestTable1"
DoCmd.SetWarnings True