Ganz grob:
Imports Microsoft.Office.Interop.Access.Dao
Module Module1
Sub Main()
Dim dbEng As New DBEngine()
Dim ws As Workspace
Dim db As Database
ws = dbEng.CreateWorkspace("", "admin", "", WorkspaceTypeEnum.dbUseJet)
db = ws.OpenDatabase("z:\\docs\\test.accdb", False, False, "")
db.Execute("SELECT * INTO Newtable From [ODBC;DSN=MySQL;].test")
End Sub
End Module
Sie könnten auch eine Abfrage in diesen Zeilen haben:
SELECT * INTO Newtable FROM
[ODBC;Driver={MySQL ODBC 5.1 Driver};Server=127.0.0.1;Database=test;User=usr;Password=pwd;CLIENT_MULTI_RESULTS;Option=3;].test;