Problems with Foxpro dsnless linked tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dan Stoica
    New Member
    • Jul 2024
    • 1

    Problems with Foxpro dsnless linked tables

    Hello!
    I have a problem when i try to connect two different Foxpro table which are located in different folders. The first link goes fine but when i try to link the second table although in the ConnectionStrin g I specify the path correctly (witch is different from the first path) i get an error. Apparently the ConnectionStrin g in the moment when is appended to TableDef becomes the path of the first table (where the second table it is not).
    Bellow is the code witch i used for dsnless link the table. I am pretty sure thet is correct (because the first table apear correct linked and opes in database window).

    Set db = CurrentDb
    Set tdf = db.CreateTableD ef([table_name])
    tdf.Connect = "ODBC;DRIVER={M icrosoft FoxPro VFP Driver (*.dbf)};Source DB=[path]" & _ ";SourceType=DB F;Exclusive=No; BackgroundFetch =Yes;Collate=Ma chine;Null=Yes; Deleted=Yes;"
    tdf.SourceTable Name = [source_table_na me]
    db.TableDefs.Ap pend tdf

    What is wrong? What i can do to correct the error and to link multiple tables from diffrent locations?
    Any help will be appreciated.
    Thanks a lot in advance for your help.!
Working...