How To…Create a DataPipeline in Code

Question

“How do I create a DataPipeline in code?”

Solution

Datapipelines can easily be created dynamically in code by assigning a few key properties.

    1. Create the TppDBPipeline object:

FDataPipeline := TppDBPipeline.Create(Self);

    1. Give the pipeline a recognizable name.

FDataPipeline.Name := ‘plCustomers’;
FDataPipeline.UserName := ‘Customers’;

    1. Assign the DataSource property.

FDataPipeline.DataSource := dsCustomers;

    1. Assign any other properties you may need.

FDataPipeline.SkipWhenNoRecords := True;

Download: CreateDataPipeline.zip

Sample Delphi code: