DBSETLAPP

Sets the application name in the LOGINREC structure.

Syntax

RETCODE DBSETLAPP (
PLOGINREC
loginrec,
LPCSTR
application );

where

loginrec
Is a pointer to a LOGINREC structure, which is passed as a parameter to dbopen. You can get one of these pointers by calling dblogin.
application
Is the application name that will be sent to SQL Server. It must be a null-terminated character string. The maximum length of the string is 30 characters, not including the null-terminating character. SQL Server stores only the first 16 characters and ignores the rest.

Returns

SUCCEED or FAIL.

Remarks

DBSETLAPP sets the application field in the LOGINREC structure. For it to have any effect, it must be called before dbopen. DBSETLAPP is optional. If not called, the application name is set to NULL.

SQL Server uses the application name in its sysprocesses table to help identify your process. If you set the application name, you will see it if you query the sysprocesses table in the master database.

See Also

dblogin, dbopen, DBSETLHOST, DBSETLPWD, DBSETLUSER