MDAC 2.5 SDK - ODBC Desktop Database Drivers


 

SQLDriverConnect

SQLDriverConnect enables you to connect to a driver without creating a data source (DSN).

The following keywords are supported in the connection string for all drivers: DSN, DBQ, and FIL.

The following table shows the minimum keywords required to connect to each driver, and provides an example of keyword/value pairs used with SQLDriverConnect. For a full list of DRIVERID values, see SQLConfigDataSource.

Note   If DBQ or DefaultDir is not specified for the Microsoft Excel 3.0 or 4.0 driver, the driver will connect to the current directory.

Driver Keywords Required Examples
Microsoft Excel 3.0 or 4.0 Driver, DriverID Driver={Microsoft Excel Driver (*.xls)};
DBQ=c:\temp; DriverID=278
Microsoft Excel 5.0/7.0 Driver, DriverID,
DBQ
Driver={Microsoft Excel Driver (*.xls)};
DBQ=c:\temp\sample.xls;
DriverID=22
Microsoft Excel 97 Driver, DriverID,
DBQ
Driver={Microsoft Excel Driver (*.xls)};
DBQ=c:\temp\sample.xls;
DriverID=790