SQLBrowseConnect

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 The name of the data source as it is returned by SQLDataSources. The DSN keyword is not used if the DRIVER keyword is used.
DRIVER N/A No The SQL Server driver name is {SQL Server}. (For a 16-bit program, the 32-bit driver name is {SQL Server (32 bit)}.)

Level 2




Keyword
List of valid values returned?


Optional?



Description
SERVER Yes No The 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 SQL Server can be used, even when this is a non-networked version. Note that when the 16-bit SQL Server driver is using "(local)" without a network, the "MS Loopback Adapter" must be installed.
UID No Yes The user login ID.
PWD No Yes (depends on the user) The user-specified password.
APP No Yes The name of the application calling SQLBrowseConnect.
WSID No Yes The workstation ID. Typically, this is the network name of the computer on which the application resides.

Level 3




Keyword
List of valid values returned?


Optional?



Description
DATABASE Yes Yes The name of the SQL Server database.
LANGUAGE Yes Yes The 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 that is 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. If the user doesn't have access to the chosen database, SQLBrowseConnect returns SQL_NEED_DATA and the level 3 connection attributes.