IDtUserProviderEx.Module

Syntax

Module: IMetabaseObjectDescriptor;

Description

The Module property determines the Fore unit or assembly of the repository where custom 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;

On executing the example, custom algorithm loads strings from data source to the Values array. In the console window the number of actual loaded strings will be shown.

See also:

IDtUserProviderEx