SqlOpenConnection%

Opens a login record, establishes a connection to the server, and then deallocates the login record.

Syntax

SqlOpenConnection% ( server$, loginid$, pwd$, workstation$, app$ )

where

server$
Is the name of the SQL Server you want to connect to.
loginid$
Is the login identification number sent to the server. The string can have as many as 30 characters.
pwd$
Is the password sent to the server. The string can have as many as 30 characters.
workstation$
Is the workstation name sent to the server. The string can have as many as 30 characters.
app$
Is the application name sent to the server. The string can have as many as 30 characters.

Returns

The identifier of a SQL Server connection. If the connection cannot be created, 0 is returned.

Remarks

SqlOpenConnection performs the actions required to open a login record, establish a connection to the server, and then free the memory allocated for the login record. It is the equivalent of combining calls to SqlLogin%, SqlSetLUser%, SqlSetLPwd%, SqlSetLApp%, SqlOpen%, and SqlFreeLogin.

Important Do not modify the identifier returned by SqlOpenConnection in any way. Modifying the identifier can cause unpredictable results.

See Also

SqlFreeLogin, SqlLogin%, SqlOpen%, SqlSetLApp%, SqlSetLPwd%, SqlSetLUser%