DBSETLSECURE

Sets the secure connection flag in a LOGINREC structure.

Syntax

RETCODE DBSETLSECURE ( PLOGINREC ploginrec );

where

ploginrec
A pointer to a LOGINREC structure, which is passed as a parameter to dbopen. You can get one of these pointers by calling dblogin.

Returns

SUCCEED or FAIL.

Remarks

By setting the secure connection flag in a LOGINREC structure with DBSETLSECURE, the application requests a secure, or trusted, connection to SQL Server. This means that SQL Server will use integrated login security to establish connections made (using dbopen) with this LOGINREC, regardless of the current login security mode at the server. Any login ID or password supplied by DBSETLUSER or DBSETLPWD is ignored.

To use DBSETLSECURE and trusted connections, you must first use xp_grantlogin or SQL Security Manager to grant SQL Server system administrator or user privilege to the appropriate Windows NT - based groups or users. Use xp_revokelogin or SQL Security Manager to revoke SQL Server privileges and stop a user or group from using a trusted connection.

Note that DBSETLSECURE enables trusted connections even when the server is in standard login security mode.

See Also

dblogin, dbopen, DBSETLAPP, DBSETLHOST, DBSETLUSER