Link to home
Start Free TrialLog in
Avatar of Phil
PhilFlag for United States of America

asked on

Linking SQL Server tables via VBA in Access 2010 generates error

I am attempting to link SQL Server 2012 tables in my Access 2010 database running in 2003 mode via vba. I get the following error:
Could not find installable ISAM.

The code I am using is:

Sub LinkTables(sTbl As String)
    Dim db As DAO.Database
    Dim tdf As DAO.TableDef
   
    Set db = CurrentDb()
    Set tdf = db.CreateTableDef(sTbl)
    tdf.SourceTableName = sTbl
    db.TableDefs.Delete sTbl
    tdf.Connect = sConnect
   
    db.TableDefs.Append tdf
    db.TableDefs.Refresh
   
    Set tdf = Nothing
    Set db = Nothing
End Sub
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Phil

ASKER

Thanks so much Jim, you have done it again!!!! Wonderful.