how to make update to BE just one time via distributed FE

J

jesperfj

I have a database running in a BE/FE setup, ca. 30 users.
I'd like to run som action queries or SQL on the BE, but I don't have (easy)
access to the BE.
Thus I'd like to create functionality in the FE that will run the queries.
But the queries should only run one time and one time only.

How can I go about this? A table in the FE with the SQLs wont work as each
user has a FE and thus everyone will attempt to run the same SQL.
I cant write to the BE. Maybe use textfiles in the BEs location that holds
info about SQL that was run?

Thanks for any ideas.
 
D

Douglas J. Steele

You could have your code check whether the change has already been made
(does the new table/field exist?), or you could add a Version property to
both your front end and back end, and have code that checks whether they're
the same.
 
C

Clifford Bass

Hi,

This is written under the presumption that you are not changing tables
and fields in the back end, only data, and as such cannot just check to see
if a table has changed.

Perhaps a silly question: Are there multiple people who access the same
back end? If so, you may have an added issue of preventing the queries from
being run more than once should two different people open the front ends at
the same time. Then there is the issue that you say "queries", as in more
than one query. Suppose the process bombs after three queries and there are
three that do not get done? Or a second person starts up their copy of the
front end while the process is partially completed in the first person's?
Or, even the same user might open a second instance of his/her own front end.

One possibilitity might to separate the update process from the front
end. In that separate process, use transaction processing over the process
as a whole so that all the queries succeed or they all fail. Important
aside: Make sure they do a backup first.

You say you do not have "(easy) access to the BE". But that would not
prevent you from creating a table in the back end via code. In code, connect
directly to the BE and create a new table in which you can record that the
process has been run and when. Doug's thought about version information is
good. You could store the pertinent information in this new table. Include
the recording of the process's success in the transaction.

If you do that then you can add into both your update process and into
the front end a check to see if the upgrade has been completed successfully.
In the front end, it will not allow continuing if the update has not been
done. In the update process it will either run the process or report that it
has already been completed.

Clifford Bass
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top