Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 2.23 KB

connecting-with-sqldriverconnect.md

File metadata and controls

43 lines (32 loc) · 2.23 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Connecting with SQLDriverConnect
SQLDriverConnect provides additional connection functionality over SQLConnect, including options to prompt the user for more information.
David-Engel
davidengel
08/20/2020
sql
connectivity
conceptual
data sources [ODBC], connection functions
functions [ODBC], data source or driver connections
connecting to data source [ODBC], SQLDriverConnect
connecting to driver [ODBC], SQLDriverConnect
connecting to data source [ODBC], functions
connecting to driver [ODBC], functions
SQLDriverConnect function [ODBC], connecting
connection functions [ODBC]
ODBC drivers [ODBC], connection functions

Connecting with SQLDriverConnect

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.