PerformLogonRoleO(
Options: Integer;
LogonData: ISecurityPackageLogonData;
UserCredentials: ICredentials;
MetaKey: Integer;
ObjectKey: Integer): ISecurityConnection;
Options. A connection parameter. Defines whether audit errors are recorded in the access protocol in the current implementation. If the "1" value is passed, the respective record is added to the access protocol when an error occurs.
LogonData. The security module parameters, used when connecting.
UserCredentials. The user's credentials, used when connecting.
MetaKey . A parameter, reserved for inner use. The "0" value has to be passed as a value.
ObjectKey. A parameter, reserved for inner use. The "0" value has to be passed as a value.
The PerformLogonRoleO method creates a new connection with the DB server, using the specified parameters values, with checking of an application role.
Sub Main;
Var
Package: ISecurityPackage;
MSSQLSPLD: IPrimaryMsSqlSPLD;
Cred: IPasswordCredentials;
Connection: ISecurityConnection;
ColCur: IDalColumns;
Field: IDalCursorField;
Begin
Package := New StandardSecurityPackage.Create;
MSSQLSPLD := Package.CreateLogonData("MSSQL2008") As IPrimaryMsSqlSPLD;
MSSQLSPLD.Database := "Test_Schema_MSSQL";
MSSQLSPLD.Server := "Test_MSSQL";
Cred := Package.CreateCredentials(AuthenticationMode.Role) As IPasswordCredentials;
Cred.UserName := "Test_Schema_MSSQL";
Cred.Password := "Test_Schema_MSSQL";
Connection := Package.PerformLogonRoleO(1, MSSQLSPLD, Cred, 0, 0);
ColCur := Connection.Columns("Table_1");
While Not ColCur.Eof Do
For Each Field In ColCur.Fields Do
Debug.WriteLine(Field.Name + " " + Field.Value);
End For;
Debug.WriteLine("");
ColCur.Next;
End While;
ColCur.Close;
End Sub Main;
After executing the example a new connection to the Test_Schema_MSSQL schema, located on the Test_MSSQL server, is performed with the specified credentials. Connection is performed with checking of role of the specified user. System information about the Table_1 table, if there is such in this scheme, is obtained and displayed in the development environment console.
See also: