Windows Dev Center

SQLDriverConnect (Extension Level 1)

Use the SQLDriverConnect function to connect an application to a data source.

Note  For more information about support or requirements for installation on a specific operating system, see Operating System Availability of WMI Components.

In the connection string to SQLDriverConnect, the caller specifies either of the following strings (both strings can include the optional correlation keywords as described below):

  • "DSN=dataSourceName"
  • "DRIVER=driverName"

In addition to the standard data source name, user name, and password, the adapter uses the attribute-keywords that are listed in ODBC Attribute-Keywords. If you specify the DRIVER keyword, the user is prompted to enter a database category.

If you have not specified enough information in the connection string (and if the fCompletionFlag parameter is not SQL_NO_PROMPT), then the Configure Connection dialog box that allows users to select namespaces appears. This dialog box contains a standard tree control that shows the nesting of namespaces. Each namespace has an associated bitmap image that represents its state. You can also use the dialog box to select namespaces from a remote WMI repository.

If you choose to manually enter a remote server name in the edit box (maximum length 128 characters), the update does not take place until you exit the edit control using the TAB key. The current tree control is cleared and replaced by the tree control for the new remote server. If the edit box does not contain any text, then the local server is used.

 

 

Show:
© 2015 Microsoft