DBSETLHOST

Sets the workstation name in the LOGINREC structure.

Syntax

RETCODE DBSETLHOST ( PLOGINREC loginrec, LPCSTR workstation );

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.
workstation
Is the workstation name to 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 10 characters and ignores the rest.

Returns

SUCCEED or FAIL.

Remarks

For DBSETLHOST to have any effect, call it before dbopen.

The workstation name shows up in the sysprocesses table in the master database, or on the screen if you issue an sp_who command.

Calling DBSETLHOST is not necessary, because if it's not called, DB-Library sets the workstation name to NULL.

See Also

dblogin, dbopen, DBSETLAPP, DBSETLPWD, DBSETLUSER