ConnectionString: String;
The ConnectionString property determines connection string used for connection to data consumer.
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 disk C root directory. There is a table named Table_1 in the database.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
EtlTask: IEtlTask;
EtlConsumer: IEtlPlainDataConsumer;
OleDbConsumer: IDtOleDbConsumer;
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 consumer creation
//The Export To OleDb object creation
EtlConsumer := EtlTask.Create(EtlObjectType.PlainDataOleDbConsumer) As IEtlPlainDataConsumer;
EtlConsumer := EtlConsumer.Edit;
EtlConsumer.Id := "OleDb_Consumer";
EtlConsumer.Name := "Export to OleDb";
EtlConsumer.Description := "Export to OleDb";
//Set up data consumer
OleDbConsumer := EtlConsumer.Consumer As IDtOleDbConsumer;
OleDbConsumer.ConnectionString := "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db.mdb;Persist Security Info=False";
OleDbConsumer.Table := "Table_1";
EtlConsumer.FillDefault;
//Save consumer
EtlConsumer.Save;
//End of consumer creation
//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(50, 50);
WxConsumer.Extension := WxETLConsumer As IWxShapeExtension;
//End of visual object creation
//Save Etl task
MObj.Save;
End Sub Main;
After executing the example in the task ETL the object Export through OleDb is created. The consumer exports data into the Table_1 table that is stored in the Access db.mdb database.
See also: