Add a remote password to the LOGINREC structure.
RETCODE dbrpwset(loginrec, srvname, password, pwlen) LOGINREC *loginrec; char *srvname; char *password; int pwlen;
A pointer to a LOGINREC structure. This pointer will serve as an argument to dbopen. You can allocate a LOGINREC structure by calling dblogin.
The name of a server. A server’s name is stored in the srvname column of its sysservers system table. When the first server calls a stored procedure located on the server designated by srvname, it will use the specified password to log in. If srvname is NULL, the specified password will be considered a “universal” password, to be used with any server that does not have a password explicitly specified for it.
The password that the first server will use to log in to the specified server.
The length of the password in bytes.
SUCCEED or FAIL.
This routine may fail if the addition of the specified password would overflow the LOGINREC’s remote password buffer. (The remote password buffer is 255 bytes long. Each password’s entry in the buffer consists of the password itself, the associated server name, and 2 extra bytes.)
A Transact-SQL command batch or stored procedure running on one server may call a stored procedure located on another server. To accomplish this server-to-server communication, the first server, connected to the application through dbopen, actually logs into the second, remote server and performs a remote procedure call.
dbrpwset allows the application to specify the password to be used when the first server attempts to call the stored procedure on the remote server. Multiple passwords may be specified, one for each server that the first server might need to log in to.
If the application has not specified a remote password for a particular server the password defaults to the one set with DBSETLPWD (or a null value, if DBSETLPWD has not been called). This behavior may be fine if the application’s user has the same password on multiple servers.
dbrpwclr clears all remote passwords from the LOGINREC.
dblogin, dbopen, dbrpwclr, DBSETLAPP, DBSETLHOST, DBSETLPWD, DBSETLUSER