IDtUserProviderEx.Module

Syntax

Module: IMetabaseObjectDescriptor;

Description

The Module property determines the Fore unit or assembly of the repository where user algorithm of data extraction is implemented.

Comments

The Module property is used in combination with the Macro property.

Example

Executing the example requires a unit with the CUSTOM_IMPORT identifier containing the MyDtCustomProvider class.

Add links to the Dt, Metabase system assemblies.

Sub UserProc_CustomObject;
Var
    MB: IMetabase;
    UsProv: IDtUserProviderEx;
    CustProv: IDtCustomProvider;
    Values: Array;
    ReadingRows: Integer;
Begin
    MB := MetabaseClass.Active;
    UsProv := 
New DtUserProviderEx.Create;
    UsProv.Metabase := MetabaseClass.Active;
    UsProv.Module := MB.ItemById(
"CUSTOM_IMPORT");
    UsProv.Macro := 
"MyDtCustomProvider";
    UsProv.Open;
    UsProv.FieldsFromFile;
    CustProv := UsProv.CustomObject 
As IDtCustomProvider;
    
If CustProv.ImplementFetchRows Then
        CustProv.FetchRows(
10, Values);
    
Else
        
While Not CustProv.Eof Do
            CustProv.Fetch(Values);
        
End While;
    
End If;
    ReadingRows := CustProv.ReadingRowsCount;
    Debug.WriteLine(
"Read " + ReadingRows.ToString + " rows");
    UsProv.Close;
End Sub UserProc_CustomObject;

After executing the example the user algorithm loads rows from data provider to the Values array. The console window displays the number of actual loaded rows.

See also:

IDtUserProviderEx