Connecting to a Data Source

[This is preliminary documentation and subject to change.]

In the connection string to SQLDriverConnect, the caller specifies either:

In addition to the standard data source name, user name, and password, the adapter recognizes the attribute-keywords NAMESPACES, DBQ, HOME, and SERVER.

If you specify the DRIVER keyword, the user is prompted to enter a database category.

Note  If SQLDriverConnect is called with an fCompletionFlag of SQL_NO_PROMPT, SQLDriverConnect returns an error.

The keyword value is a string used to filter the total number of databases in WBEM. This number depends on the global environment variable ODBC Category, the value of which is equal to the keyword value. However, if the category string is ALL, then all databases are considered as included in this data source.

If the connection string information is insufficient and the fCompletionFlag is not SQL_NO_PROMPT, a dialog box is displayed for namespace selection. In this dialog box, a tree control shows the nesting of namespaces. Each namespace has an associated bitmap image representing its state. The bitmap image looks like a checkbox with a folder.

Clicking the folder alternately selects and cancels the selection of the namespace. If the checkbox or folder is not expanded (denoted by a + button next to the control), then all items in the folder are selected or canceled, depending on the current state of the folder. If the folder is already expanded or has no child items, then only the folder is affected.

The state of each folder is represented as follows:

Clear Unchecked Checkbox Item is not selected and no child items (if any) are selected.
Gray Unchecked Checkbox At least one child item is selected.
Clear Checked Checkbox Item is selected but no child items (if any) are selected.
Gray Checked Checkbox Item is selected and at least one child item is selected.

The dialog box also allows namespace selection from a remote WBEM database. This functionality is available through the Browse button and text box.

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

Click the Browse button to display a new Server Selection dialog box. This presents information similar to the Microsoft® Windows NT® Network Neighborhood. The dialog box initially displays the network resources on the local area network (LAN). Another link enables you to view the entire network (represented by a globe). If you double-click on an image that does not represent a server, then the current display is cleared and the contents of the chosen network resource are displayed.

The dialog box also has three bitmap buttons: