Bewerken

Delen via


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.