IDatabaseInitExecuteSetup.Macro

Syntax

Macro: String;

Description

The Macro property determines the name of the method, which will be executed on connecting to the database.

Comments

As the value of this property should be specified the name of the statistical procedure, having only one parameter with the ISecurityConnection type. The procedure must be implemented in the object, which is specified in the Module property. The name is specified in the following format: <ClassName>.<ProcedureName>.

The procedure is performed right after connection and before of any other queries. Created connection is available in the procedure input parameter. Using interfaces of the Dal assembly, some advanced settings can be configured.

Example

Executing the example requires that the repository contains a database with the BD identifier. The repository should also contain a unit with the PREPAREDB identifier. The module has a procedure that will be called after connecting to database.

Module text

Sub UserProc;
Var
    MB: IMetabase;
    DB: IDatabaseInitExecuteSetup;
Begin
    MB := MetabaseClass.Active;
    DB := MB.ItemById("BD").Edit As IDatabaseInitExecuteSetup;
    DB.Module := MB.ItemById("PREPAREDB");
    DB.Macro := "PrepareDB.OnDBConnecting";
    (DB As IMetabaseObject).Save;
End Sub UserProc;

After executing the example advanced settings of the repository database will be determined. The specified procedure will be executed after connecting.

See also:

IDatabaseInitExecuteSetup