Linking External DB to Access (Follow-up) 
Author Message
 Linking External DB to Access (Follow-up)

I had asked how to link an external database to
Access 2000 from a VB program, and someone gave
me the code below.  The code links a SQL Server
table beautifully, but the problem is that I am trting
to link DBase and Paradox tables.  Access will not
allow an ODBC link for ISAM databases.  Can anyone
offer any further help on this topic?



sSQLServerConnString = "ODBC;" & _
                                       "Driver={SQL Server};" & _
                                       "Server=(local);" & _
                                       "Database=pubs;" & _
                                      '    "Uid=sa;" & _
                                      '    "Pwd=;"

' Create and open an ADOX connection to Access database
Set oCat = New ADOX.Catalog
oCat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                                           "Data Source=.\advworks.mdb;"

' Create a new Table object
Set oTable = New ADOX.Table
With oTable
    .Name = "authors"
    Set .ParentCatalog = oCat
    .Properties("Jet OLEDB:Create Link") = True
    .Properties("Jet OLEDB:Remote Table Name") = "authors"
    .Properties("Jet OLEDB:Link Provider String") = sSQLServerConnString
End With

' Add Table object to database
oCat.Tables.Append  oTable

Sun, 10 Aug 2003 21:54:17 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Linking Symbols to an External db Form

2. VB Code Linking to External DB Sources

3. Create a Linked table to external text file in Access

4. Backing up tables to external access db's

5. Access external DB in VBA

6. VBA: linking a table from a secured access-db

7. Linking to a secure Access DB from VB5.0

8. Link Visio with DB Access 2000

9. Saving embedded word 97 docs in Access db with linked SQL Server tables

10. ACCESS/ORACLE db linking/stored procedures

11. DBCombo with Access DB link

12. Linking HTML to an Access DB


Powered by phpBB® Forum Software