Forum : How do I build a connection string using FlexODBC?Search Forum

Forum Home > FlexODBC - ODBC Driver for DataFlex Embedded DBMS > FlexODBC Frequently Asked Questions

 New Topic 
 
 Post Reply 
 How do I build a connection string using FlexODBC? 
 Author   Message 
  Tom Aczel 
  dd4bf_dawworld.jpg
 Group: Administrator 
 Posts: 6281 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-04-13 14:11:25

Connection String
The most difficult part of using FlexODBC in programming is the connection string. The simplest form includes a reference to a DSN. A DSN called "DataFlex Test32" is automatically created when FlexODBC is installed. "DataFlex Test32" will be used in all examples but can be substituted with any different DSN name you create.
 
Normally ADO pools connections. FlexODBC does not support connection pooling. It is recommended to tell ADO to not do connection pooling on any FlexODBC connection. This is done with OLE DB Services=-2.

Example of simple DSN:
    sConnectString = "DSN=DataFlex Test32;OLE DB Services=-2;"
 
Example of a DSNless connection string:
    sConnectString = "Driver={DataFlex Driver};DFQ=C:\PROGRA~1\FLEXOD~1\TestData;OLE DB Services=-2;"
 
Example using current ADO syntax:
    sConnectString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=DataFlex Test32;OLE DB Services=-2;"

Standard syntax:
"DRIVER={DataFlex Driver};SERVER=FlexODBC;DFQ=.;OLE DB Services=-2;

Where:
DFQ=
 (./[path to DataFlex .dat files]) where . means the current DFPath environment setting or the DOS path to the datafiles.
OLE DB Services=-2;

 

 

  Top 
 New Topic 
 
 Post Reply 

Jump to