I am trying to add a linked table to an Acccess database using ADO and ADOX (from excel).
However everytime I try, I receive the error: "Microsoft Access does not support linking to an Access database or Microsoft Office Excel workbook saved in a format that is a later version than the current database format."
Both the linked table and the target database are made using Access 2010 and are of the .accdb format. My code:
Set cat = New ADOX.Catalog
Set tbl = New ADOX.Table
' Open the catalog.
cat.ActiveConnection = objConnection
tbl.ParentCatalog = cat
tbl.Name = "Promotions"
tbl.Properties("Jet OLEDB:Link Datasource") = strCurrentPath & _
"LocPrcCh.accdb"
tbl.Properties("Jet OLEDB:Remote Table Name") = "Promotions"
tbl.Properties("Jet OLEDB:Create Link") = True
tbl.Properties("Jet OLEDB:Link Provider String") = _
"MS Access;PWD=XXXXXXXXX;"
cat.Tables.Append tbl
Returns the error after the last line. Any ideas how to make this work?