Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 1.67 KB

connecting-directly-to-drivers.md

File metadata and controls

26 lines (23 loc) · 1.67 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Connecting Directly to Drivers
Connecting Directly to Drivers
David-Engel
davidengel
01/19/2017
sql
connectivity
conceptual
connecting to driver [ODBC], SQLDriverConnect
connecting to data source [ODBC], SqlDriverConnect
SQLDriverConnect function [ODBC], connecting directly to drivers
connecting to driver [ODBC], drivers

Connecting Directly to Drivers

As was discussed in Choosing a Data Source or Driver, earlier in this section, some applications do not want to use a data source at all. Instead, they want to connect directly to a driver. SQLDriverConnect provides a way for the application to connect directly to a driver without specifying a data source. Conceptually, a temporary data source is created at run time.

To connect directly to a driver, the application specifies the DRIVER keyword in the connection string instead of the DSN keyword. The value of the DRIVER keyword is the description of the driver as returned by SQLDrivers. For example, suppose a driver has the description Paradox Driver and requires the name of a directory containing the data files. To connect to this driver, the application might use either of the following connection strings:

DRIVER={Paradox Driver};Directory=C:\PARADOX;  
DRIVER={Paradox Driver};  

With the first string, the driver would not need any additional information. With the second string, the driver would need to prompt for the name of the directory containing the data files.