SQLBrowseConnect (ODBC)

SQLBrowseConnect uses keywords that can be categorized into three levels of connection information. For each keyword, the following table indicates whether a list of valid values is returned and whether the keyword is optional.

Level 1

Keyword List returned? Optional? Description
DSN N/A No Name of the data source as it is returned by SQLDataSources. The DSN keyword cannot be used if the DRIVER keyword is used.
DRIVER N/A No SQL Server ODBC driver name is {SQL Server} or SQL Server (the braces are required when using the 2.65 or earlier versions of the driver). The DRIVER keyword cannot be used if the DSN keyword is used.

Level 2

Keyword List returned? Optional? Description
SERVER Yes No Name of the server on the network on which the data source resides. When running on Microsoft® Windows NT®, “(local)” can be entered as the server, in which case a local copy of Microsoft SQL Server™ can be used, even when this is a nonnetworked version.
UID No Yes User login ID.
PWD No Yes (depends on the user) User-specified password.
APP No Yes Name of the application calling SQLBrowseConnect.
WSID No Yes Workstation ID. Typically, this is the network name of the computer on which the application runs.

Level 3

Keyword List returned? Optional? Description
DATABASE Yes Yes Name of the SQL Server database.
LANGUAGE Yes Yes National language to be used by SQL Server.

SQLBrowseConnect ignores the values of the DATABASE and LANGUAGE keywords that are stored in the ODBC data source definitions. If the database or language specified in the connection string passed to SQLBrowseConnect is invalid, SQLBrowseConnect returns SQL_NEED_DATA and the level 3 connection attributes.

SQLBrowseConnect doesn’t check user access to all the databases listed with the DATABASE keyword when connected to SQL Server version 6.5 or earlier servers. If the user doesn’t have access to the chosen database, SQLBrowseConnect returns SQL_NEED_DATA and the level 3 connection attributes.


(c) 1988-98 Microsoft Corporation. All Rights Reserved.