Link table using ole db
Posted on 2006-03-30
I'm using Access 2003
I have the following code which will output the table names.
I can not get the transferdatabase link line to work however.
I would like to link to the tables so i can run reports etc.
I can link to a table using Excel but not access
I will be happy with a programic or user interface way to link to the tables.
At a last resort I could import the table.
I belive my troubles have someting to do with the difference between ODBC and OLE DB.
I do not have the ODBC option with this database.
Private Sub Command0_Click()
Dim oConn As New ADODB.Connection
oConn = "Provider=ACTOLEDB.1;Data Source=C:\Documents and Settings\SERVERADMIN\My Documents\ACT_DATABASE\LectureLinx.pad;User ID=admin;Password=admin"
Dim cstring As String
cstring = "Provider=ACTOLEDB.1;Data Source=C:\Documents and Settings\SERVERADMIN\My Documents\ACT_DATABASE\LectureLinx.pad;User ID=admin;Password=admin"
Set rs = oConn.OpenSchema(adSchemaTables)
Do While Not rs.EOF
DoCmd.TransferDatabase acLink, "ODBC Database", cstring, "VRP_Contact"