skip to main content
Developing ODBC Applications : Specifying Application IDs : Specifying Application IDs Explicitly
 

Specifying Application IDs Explicitly

ODBC client applications can identify themselves explicitly to the OpenAccess SDK Server in any of the following ways:
Specifying the application ID in the ODBC connection string that is passed to SQLDriverConnect. For example:
....;APPID=MyAppID;
or
....;ApplicationID=MyAppID;
where MyAppID is the application ID.
Specifying the application ID using SQLSetConnectAttr. Immediately after each call to SQLConnect or SQLDriverConnect connecting to the ODBC Client, call SQLSetConnectAttr as shown:
SQLSetConnectAttr(hdbc, 1053, "myAppId", SQL_NTS)
where myAppId is the application ID.
The SQLSetConnectAttr is defined in sql.h. If an incorrect application ID is specified, the SQLSetConnectAttr fails and all subsequent SQL statements fail.