Skip to content

TFloDataSource.DBConCount ​

Using the keyword source or dest, this returns the actual number of DB Connections listed in the Data Definition that is being connected to.

In this example there is a count of 4.

In this example, the count is 2.

This property is read only.

Do not set this property to another value during the Map.

Declaration: property DBConCount: integer;

It can be used in the following way to return the name of the file this Data Definition is connected to, including the full path. As a zero (0) based array, Source.DBCons[0] would be the 1st source definition, Source.DBCons[1] would be the 2nd listed, and so on.

pascal
procedure OnMapEvent(var Value:Variant);
begin
 //Check for the number of DB Connections listed in the SOURCE File Def or DB Def
 if Source.DBConCount >= 2 then
 //If there are 2 or more, what is the name of the 2nd DB Connection database
    Value := Source.DBCons[1].DBCon.Database;
end;

Or perhaps, it could be used like this example.

pascal
procedure OnMapEvent(var Value:Variant);
begin
 //Check for the number of DB Connections listed in the DEST File Def or DB Def
 if Dest.DBConCount >= 2 then
 //If there are 2 or more, what is the name of the 1st DB Connection database
    Value := Dest.DBCons[0].DBCon.Database;
end;