Connection strings for Visual FoxPro / FoxPro 2.x

For version 8 and up its recommended to use the OLEDB driver as the ODBC driver does not recognize autoincrement fields and does not support stored procedures. The last ODBC update was for VFP 6 (version 6.0.8167) which is also compatible with VFP 7.

OLE DB providers for Visual FoxPro / FoxPro 2.x

.NET libraries for Visual FoxPro / FoxPro 2.x

ODBC drivers for Visual FoxPro / FoxPro 2.x

VFP OLE DB Provider

Type OLE DB Provider
Usage Provider=vfpoledb
Manufacturer Microsoft

Database container (.DBC)

Provider=vfpoledb;Data Source=C:\MyDbFolder\MyDbContainer.dbc;
Collating Sequence=machine;
 
 

Free table directory

Provider=vfpoledb;Data Source=C:\MyDataDirectory\;Collating Sequence=general;
 
 

Connect to a single DBF-file

Provider=vfpoledb;Data Source=C:\MyDataDirectory\MyTable.dbf;Collating Sequence=machine;
 
 

Force the provider to use an ODBC DSN

Provider=vfpoledb;DSN=MyDSN;
 
 

.NET Framework Data Provider for OLE DB

Type .NET Framework Wrapper Class Library
Usage System.Data.OleDb.OleDbConnection
Manufacturer Microsoft

Use an OLE DB provider from .NET

Provider=any oledb provider's name;OledbKey1=someValue;OledbKey2=someValue;

See the respective OLEDB provider's connection strings options. The .net OleDbConnection will just pass on the connection string to the specified OLEDB provider. Read more here.

 
 

Microsoft Visual FoxPro ODBC Driver

Type ODBC Driver
Usage Driver={Microsoft Visual FoxPro Driver}
Manufacturer Microsoft

Database container (.DBC)

Driver={Microsoft Visual FoxPro Driver};SourceType=DBC;SourceDB=c:\myvfpdb.dbc;
Exclusive=No;NULL=NO;Collate=Machine;BACKGROUNDFETCH=NO;DELETED=NO;

Note that DELETED=NO will cause the driver to include deleted rows in the resultset. To not retrieve deleted rows specify DELETED=YES. The terminology is a bit confusing here, a more appropriate keyword would have been IGNORE DELETED instead of DELETED.

 
 

Free Table directory

Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=c:\myvfpdbfolder;
Exclusive=No;Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;

Note that DELETED=NO will cause the driver to include deleted rows in the resultset. To not retrieve deleted rows specify DELETED=YES. The terminology is a bit confusing here, a more appropriate keyword would have been IGNORE DELETED instead of DELETED.

 
 

.NET Framework Data Provider for ODBC

Type .NET Framework Wrapper Class Library
Usage System.Data.Odbc.OdbcConnection
Manufacturer Microsoft

Use an ODBC driver from .NET

Driver={any odbc driver's name};OdbcKey1=someValue;OdbcKey2=someValue;

See the respective ODBC driver's connection strings options. The .net OdbcConnection will just pass on the connection string to the specified ODBC driver. Read more here.

 
 

Popular