ConnectionString: String;
The ConnectionString property determines connection string, used for connecting to data provider.
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;
EtlProvider: IEtlPlainDataProvider;
OleDbProvider: IDtOleDbProvider;
WxProvider: IWxRectangle;
WxETLProvider: 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 data provider creation
// Create the "Import from OleDb" object
EtlProvider := EtlTask.Create(EtlObjectType.PlainDataOleDbProvider) As IEtlPlainDataProvider;
EtlProvider := EtlProvider.Edit;
EtlProvider.Id := "OleDb_Provider";
EtlProvider.Name := "Import from OleDb";
EtlProvider.Description := "Import from OleDb";
// Set up data provider
OleDbProvider := EtlProvider.Provider As IDtOleDbProvider;
OleDbProvider.ConnectionString := "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db.mdb;Persist Security Info=False";
OleDbProvider.Query := "Select * from Table_1";
EtlProvider.FillDefault;
// Save data provider
EtlProvider.Save;
// End of data provider creation
// Start of visual object creation
WxProvider := EtlTask.Workspace.CreateRectangle;
WxETLProvider := New WxETLObject.Create;
WxETLProvider.ETLObject := EtlProvider;
WxProvider.Style.TextPosition := WxTextPosition.Bottom;
WxProvider.Style.PictureMarginTop := -10;
WxProvider.PinPosition := New GxPointF.Create(50, 50);
WxProvider.Extension := WxETLProvider As IWxShapeExtension;
// End of visual object creation
// Save ETL task
MObj.Save;
End Sub UserProc;
After executing the example the Import from OleDb object is created in the ETL task. This data provider extracts data from the specified table in the Access database.
See also: