Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread DataSetCount
Wed, May 2 2018 11:28 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

For a bulk import operation I've added a utility to zap everything. This doesn't work - the DataSetCount is 0

  dm.pqDatabase.Connected := True;
  for Cntr := 0 to dm.pqDatabase.DataSetCount - 1 do begin
   if dm.pqDatabase.DataSets[Cntr] is TnlhTable
    then TnlhTable(dm.pqDatabase.DataSets[Cntr]).EmptyTable;
  end;

I've altered things to loop round components on the form

  for Cntr := 0 to ComponentCount - 1 do begin
   if Components[Cntr] is TnlhTable then TnlhTable(Components[Cntr]).EmptyTable;
  end;

so I have a working solution.

At present there are two nlhTable components (my subclassed EDBTable) on the form, and they are linked to dm.pqDatabase so why am I getting zero?

Roy Lambert
Wed, May 2 2018 12:44 PMPermanent Link

Raul

Team Elevate Team Elevate

On 5/2/2018 11:28 AM, Roy Lambert wrote:
> At present there are two nlhTable components (my subclassed EDBTable) on the form, and they are linked to dm.pqDatabase so why am I getting zero?

Are they open/active ? I think only opens ones show up.

Raul
Thu, May 3 2018 2:03 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Raul


That would explain it. I thought it was just a list of everything connected to it. I've only used the approach in a couple of places and in those all the tables would have been opened.

Roy Lambert
Image