| title | Connecting with SQLDriverConnect | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| description | SQLDriverConnect provides additional connection functionality over SQLConnect, including options to prompt the user for more information. | |||||||||
| author | David-Engel | |||||||||
| ms.author | davidengel | |||||||||
| ms.date | 08/20/2020 | |||||||||
| ms.service | sql | |||||||||
| ms.subservice | connectivity | |||||||||
| ms.topic | concept-article | |||||||||
| helpviewer_keywords |
|
SQLDriverConnect is used to connect to a data source using a connection string. SQLDriverConnect is used instead of SQLConnect for the following scenarios:
-
Establish a connection using a connection string that contains the data source name, one or more user IDs, one or more passwords, and other information required by the data source.
-
Establish a connection using a partial connection string or no additional information; in this case, the Driver Manager and the driver can each prompt the user for connection information.
-
Establish a connection to a data source that is not defined in the system information. If the application supplies a partial connection string, the driver can prompt the user for connection information.
-
Establish a connection to a data source using a connection string constructed from the information in a .dsn file.
After a connection is established, SQLDriverConnect returns the completed connection string. The application can use this string for subsequent connection requests.
This section contains the following topics.