DriverVersion: String;
The DriverVersion property determines the driver version, that is used during connection.
As a value of the property the following values are available:
dBASE III.
dBASE IV.
dBASE 5.0.
VFPOLEDB.1.
Unsuccessful import with all available drivers is possible. It depends on the fact that the file with the *.dbf extension was created using the Visual FoxPro driver version. In that case, use IDtVfpProvider for data import.
IMPORTANT. For data import using the VFPOLEDB.1 driver, use 32-bit Foresight Analytics Platform because this driver does not support the work with 64-bit applications.
Executing the example requires that the repository contains an ETL task with the Etl identifier, and the Base_1.Dbf table in the disk C root directory.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
EtlTask: IEtlTask;
EtlProvider: IEtlPlainDataProvider;
DbaseProvider: IDtDbaseProvider;
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 the provider creation
//The Import From Dbase object creation
EtlProvider := EtlTask.Create(EtlObjectType.PlainDataDbaseProvider) As IEtlPlainDataProvider;
EtlProvider := EtlProvider.Edit;
EtlProvider.Id := "Dbase_Provider";
EtlProvider.Name := "Import from Dbase";
EtlProvider.Description := "Import from Dbase";
//Set up data provider
DbaseProvider := EtlProvider.Provider As IDtDbaseProvider;
DbaseProvider.Path := "c:\";
DbaseProvider.DriverVersion := "dBASE IV";
DbaseProvider.Query := "Select * from Base_1";
EtlProvider.FillDefault;
//Save provider
EtlProvider.Save;
//End of 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 Main;
After executing the example the Import from Dbase object is created in the ETL task. The provider imports data from the Base_1.Dbf table. During connection the dBASE IV drivers are used.
See also: