🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
3 messages
3 total messages Started by Ian Searle Tue, 05 Dec 2000 21:31
Iterating through data aware controls
#5966
Author: Ian Searle
Date: Tue, 05 Dec 2000 21:31
12 lines
1196 bytes
Hi All

I have an ADO multi user application. In a case where one user adds to or
updates the back-end tables, I would like the other client applications to
refelect the changes to the data immediately.

Can anyone give me some guidance on how to achieve this. I can't believe I
need to refresh data using an OnTimer event tied to a TTimer.

Many Thanks

Ian
Re: Iterating through data aware controls
#5967
Author: Ian Searle
Date: Tue, 05 Dec 2000 21:34
27 lines
1636 bytes
 Hi

Sorry....re my post, the other question is that in a form where there are a
number of buttons, a progress bar and Database edit controls, is there a way
of iterating through only the data aware components to change their data
source properties at runtime in response to, say, the user clicking on a
button.

Thanks


Ian Searle <iansearle@lightningit.co.uk> wrote in message
news:3a2d6283_1@dnews...
> Hi All
>
> I have an ADO multi user application. In a case where one user adds to or
> updates the back-end tables, I would like the other client applications to
> refelect the changes to the data immediately.
>
> Can anyone give me some guidance on how to achieve this. I can't believe I
> need to refresh data using an OnTimer event tied to a TTimer.
>
> Many Thanks
>
> Ian
>
>
Re: Iterating through data aware controls
#5984
Author: Robin Marlowe
Date: Mon, 11 Dec 2000 20:10
35 lines
1829 bytes
"Ian Searle" <iansearle@lightningit.co.uk> wrote in message
news:3a2d6336_2@dnews...
> Hi
>
> Sorry....re my post, the other question is that in a form where there are
a
> number of buttons, a progress bar and Database edit controls, is there a
way
> of iterating through only the data aware components to change their data
> source properties at runtime in response to, say, the user clicking on a
> button.
>
> Thanks
>

Well, you COULD iterate through the components the parent owns, and test
cast them e.g.

for (int i=0; i<ComponentCount; i++) {
  TDBGrid *d = dynamic_cast< TDBGrid* >(Components[i]);
  TDBEdit *e = dynamic_cast< TDBEdit* >(Components[i]);

  if (d) d->DataSource = DataSource2;
  else if (e) e->DataSource = DataSource2;
}


But isn't it simpler to just to access all the components by name?

DBGrid1->DataSource = DataSource2;
DBEdit1->DataSource = DataSource2;


Robin
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads