dbsetlhost

DB Library for C

DB Library for C

dbsetlhost

Sets the workstation name in the LOGINREC structure.

Syntax

RETCODE DBSETLHOST ( PLOGINREC loginrec, LPCSTR workstation );

Arguments

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 Microsoft® SQL Server™ 2000. 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.

If you do not call DBSETLHOST, the workstation parameter of the LOGINREC structure is set to the host workstation name by default instead of to NULL, as it is in SQL Server version 6.0 or earlier.

See Also

dblogin

dbsetlpwd

dbopen

dbsetluser

dbsetlapp