Dan Stoica
Programmer
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 ConnectionString I specify the path correctly (witch is different from the first path) i get an error. Apparently the ConnectionString 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.CreateTableDef([table_name])
tdf.Connect = "ODBC;DRIVER={Microsoft FoxPro VFP Driver (*.dbf)};SourceDB=[path]" & _ ";SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;"
tdf.SourceTableName = [source_table_name]
db.TableDefs.Append 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.!
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 ConnectionString I specify the path correctly (witch is different from the first path) i get an error. Apparently the ConnectionString 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.CreateTableDef([table_name])
tdf.Connect = "ODBC;DRIVER={Microsoft FoxPro VFP Driver (*.dbf)};SourceDB=[path]" & _ ";SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;"
tdf.SourceTableName = [source_table_name]
db.TableDefs.Append 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.!