Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Iterate through tables in a DataModule
Tue, Sep 25 2007 10:26 AMPermanent Link

"Petter Topp"
I would like to Iterate through the tables of a given DataModule to check if
the state of the tables are "dsEdit"
Was thinking of something like this, but I don't have the skill to
finish....


procedure TDM_Main.SaveDBSetup;
var
 I: Integer;
begin
 with DM_main do begin
   for I := 0 to ComponentCount - 1 do
     if Components[I] is TDbisamTable then begin
       if ......state = dsEdit then begin
         Post;
       end;
     end;
 end;
end;

Regards
Petter Topp
Dbisam C/S 4

Tue, Sep 25 2007 10:43 AMPermanent Link

"Robert"

"Petter Topp" <petter.topp@atcdata.no> wrote in message
news:0E8642BD-D094-4C65-920F-7604A3E1A31F@news.elevatesoft.com...
>      if Components[I] is TDbisamTable then begin
       with Components[I] as TDBISAMTable do begin
>        if ......state = dsEdit then begin

Robert

Thu, Sep 27 2007 10:48 AMPermanent Link

"David Farrell-Garcia"
Petter Topp wrote:

> I would like to Iterate through the tables of a given DataModule to
> check if the state of the tables are "dsEdit" Was thinking of
> something like this, but I don't have the skill to finish....

Here ya go


procedure TDM_Main.SaveDBSetup;
var
 I: Integer;
begin
 with DM_main do begin
   for I := 0 to ComponentCount - 1 do
     if Components[I] is TDbisamTable then begin
       if TDbisamTable(Components[i]).State = dsEdit then begin
         TDbisamTable(Components[i]).Post;
       end;
     end;
 end;
end;



--
David Farrell-Garcia
Whidbey Island Software, LLC
Fri, Sep 28 2007 6:00 AMPermanent Link

"Petter Topp"
Thank you very much.

Petter


"Petter Topp" <petter.topp@atcdata.no> skrev i melding
news:0E8642BD-D094-4C65-920F-7604A3E1A31F@news.elevatesoft.com...
>I would like to Iterate through the tables of a given DataModule to check
>if the state of the tables are "dsEdit"
> Was thinking of something like this, but I don't have the skill to
> finish....
>
>
> procedure TDM_Main.SaveDBSetup;
> var
>  I: Integer;
> begin
>  with DM_main do begin
>    for I := 0 to ComponentCount - 1 do
>      if Components[I] is TDbisamTable then begin
>        if ......state = dsEdit then begin
>          Post;
>        end;
>      end;
>  end;
> end;
>
> Regards
> Petter Topp
> Dbisam C/S 4
>
>

Image