Home > Archive > MS Access Multiuser > May 2005 > when to reload an ActiveX control in multi-user environment









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author when to reload an ActiveX control in multi-user environment
Christopher Glaeser

2005-05-14, 11:24 am

I have an ActiveX control that displays information based on data in a
table. Currently, I use a Timer event to reload the data from the table on
every tick to ensure the display is current. Updates to the table are rare,
and I would like to avoid unnecessary reloads from the table. How do I
determine if any records in the table have been updated since the last Timer
tick so that I can reload the ActiveX control only when necessary?

Best,
Christopher


Douglas J. Steele

2005-05-14, 1:23 pm

You can't really. Access doesn't have triggers.

I suppose if everyone's updating the table strictly through a form (as
should be the case), you could introduce a new table that has a single
boolean field to indicate whether or not the table's changed. Set the field
to True whenever anyone updates the table. When the Timer event is invoked,
read that field to see whether anything's changed. If not, do nothing. If
so, refresh your display, and set the field back to False.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Christopher Glaeser" <nospam@nospam.com> wrote in message
news:OvXYzrJWFHA.2796@TK2MSFTNGP09.phx.gbl...
>I have an ActiveX control that displays information based on data in a
>table. Currently, I use a Timer event to reload the data from the table on
>every tick to ensure the display is current. Updates to the table are
>rare, and I would like to avoid unnecessary reloads from the table. How do
>I determine if any records in the table have been updated since the last
>Timer tick so that I can reload the ActiveX control only when necessary?
>
> Best,
> Christopher
>
>



Christopher Glaeser

2005-05-14, 1:23 pm

> I suppose if everyone's updating the table strictly through a form (as
> should be the case),


Yes, I did this part right. Tables are not updated directly; only via a
form.

> you could introduce a new table that has a single boolean field to
> indicate whether or not the table's changed. Set the field to True
> whenever anyone updates the table. When the Timer event is invoked, read
> that field to see whether anything's changed. If not, do nothing. If so,
> refresh your display, and set the field back to False.


I understand the extra table, but not sure I understand the boolean. Each
user has a view of the data via the ActiveX control. After an update to the
data, if one user reloads their ActiveX control and sets the field to False,
won't the other users miss the reload? Should this field in the new table
be a timestamp on which all users can compare thier last reload?

Best,
Christopher


Tony Toews

2005-05-14, 8:24 pm

"Christopher Glaeser" <nospam@nospam.com> wrote:

>I have an ActiveX control that displays information based on data in a
>table. Currently, I use a Timer event to reload the data from the table on
>every tick to ensure the display is current. Updates to the table are rare,
>and I would like to avoid unnecessary reloads from the table. How do I
>determine if any records in the table have been updated since the last Timer
>tick so that I can reload the ActiveX control only when necessary?


One way to avoid unnecessary reloads of data would be to use a
process similar to what Outlook does when connected to an Exchange
server. Have a process running on the server, or possibly one client
workstation, which checks for new records. Once a new record is
encountered send an TCP/IP packet to the workstations notifying them
there is data available.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Douglas J. Steele

2005-05-14, 8:24 pm

"Christopher Glaeser" <nospam@nospam.com> wrote in message
news:Okbut4KWFHA.3280@TK2MSFTNGP09.phx.gbl...
>
> Yes, I did this part right. Tables are not updated directly; only via a
> form.
>
>
> I understand the extra table, but not sure I understand the boolean. Each
> user has a view of the data via the ActiveX control. After an update to
> the data, if one user reloads their ActiveX control and sets the field to
> False, won't the other users miss the reload? Should this field in the
> new table be a timestamp on which all users can compare thier last reload?


Yup, didn't think it through myself... Timestamp would work better! You
could then do a DateDiff against Now() to determine how long it's been since
the update. Since you know how frequently the timer's firing, you'd only
have to do a refresh if DateDiff returned a value less than the timer
frequency.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)




Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com