IDtAccessConsumer.File

Syntax

File: String;

Description

The File property determines the path and the name of the Access database file, in the table of which data is exported.

Example

Executing the example requires that the repository contains an ETL task with the ETL identifier and an Access database file named db.mdb in the root of the C disk. There is a table named Table_1 in the database.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    EtlTask: IEtlTask;
    EtlConsumer: IEtlPlainDataConsumer;
    AccessConsumer: IDtAccessConsumer;
    WxConsumer: IWxRectangle;
    WxETLConsumer: IWxETLObject;
Begin
    MB := MetabaseClass.Active;
    // ETL task search. Repository object with the ETL identifier
    MObj := MB.ItemById("Etl").Edit;
    EtlTask := MObj As IEtlTask;
    // Start of creating a data consumer
    // Create the "Export to Access" object
    EtlConsumer := EtlTask.Create(EtlObjectType.PlainDataAccessConsumer) As IEtlPlainDataConsumer;
    EtlConsumer := EtlConsumer.Edit;
    EtlConsumer.Id := "Access_Consumer";
    EtlConsumer.Name := "Export to Access";
    EtlConsumer.Description := "Export to Access";
    // Set up data consumer
    AccessConsumer := EtlConsumer.Consumer As IDtAccessConsumer;
    AccessConsumer.File := "c:\db.mdb";
    AccessConsumer.Table := "Table_1";
    EtlConsumer.FillDefault;
    // Save data consumer
    EtlConsumer.Save;
    // End of creating a data consumer
    // Start of visual object creation
    WxConsumer := EtlTask.Workspace.CreateRectangle;
    WxETLConsumer := New WxETLObject.Create;
    WxETLConsumer.ETLObject := EtlConsumer;
    WxConsumer.Style.TextPosition := WxTextPosition.Bottom;
    WxConsumer.Style.PictureMarginTop := -10;
    WxConsumer.PinPosition := New GxPointF.Create(5050);
    WxConsumer.Extension := WxETLConsumer As IWxShapeExtension;
    // End of visual object creation
    // Save ETL task
    MObj.Save;
End Sub UserProc;

After executing the example the Export to Access object is created in the ETL task. The data provider is set up to work with the specified tale in the Microsoft Access dataase.

See also:

IDtAccessConsumer