run function/code in different mdb

  • Thread starter Thread starter Andreas
  • Start date Start date
A

Andreas

Hi,

I have a frontend and backend database. I have a nice tool to update/
create variables in the backend with VBA (compareEM). I copy the code
to the backend with VBA.

Problem: Now I want to run the module in the backend from the frontend
(so the user just clicks "update backend" and it will close the
frontend and runs the update-function in the backend).

Is that possible?

Thank you very much!

Andreas
 
Hi Andreas

It is unusual for a backend to contain anything except data tables. Is it
not possible to put the code in your frontend?

Another way would be to call your function from a macro and use the Shell
command to run up another instance of Access and execute the macro from the
command line. The command line string for the Shell command would be
something like this:

"C:\Program Files\Microsoft Office\Office11\msaccess.exe"
"<path to your backend>" /x <name of your macro>
 
By "update backend", do you mean you are creating or altering tables in the
backend?

If so, you can do that with SQL directly from the front-end, although I
cannot think of an instance where I have needed or wanted to do this with a
production application (with the exception of creating temporary tables in
temporary databases).

Dale
 
Hi Dale and Graham,

true, the backend contains only the tables BUT the database is in
Namibia and I am sitting in Germany. So if I have to add some fields
in a table (or create a new one) I should have the backend which is a
problem, as they can't use it there any more. So my idea is to have
the same structured backend here (without the data), write the changes
in a module in the frontend (find the differences with the program
CompareEM), send the frontend to Namibia with a nice button (which
copies the module with the changes in the backend there and would -
this is what i want to know from this posting - run the code in the
backend database there. The user would only have to click on the
button in the frondend. Sounds maybe a little bit complicated, but
would make it quite easy for the user to make the changes in the
backend.

Any ideas how to run the module in the backend with an command in the
frontend?

Thanks,

Andreas

Hi Andreas

It is unusual for a backend to contain anything except data tables. Is it
not possible to put thecodein your frontend?

Another way would be to call your function from a macro and use the Shell
command torunup another instance of Access and execute the macro from the
command line. The command line string for the Shell command would be
something like this:

"C:\Program Files\Microsoft Office\Office11\msaccess.exe"
"<path to your backend>" /x <name of your macro>

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand


I have a frontend and backend database. I have a nice tool to update/
create variables in the backend with VBA (compareEM). I copy thecode
to the backend with VBA.
Problem: Now I want torunthe module in the backend from the frontend
(so the user just clicks "update backend" and it will close the
frontend and runs the update-function in the backend).
Is that possible?
Thank you very much!
 
What I generally do, when I distribute a front end that requires changes to
the backend is write a subroutine (in the front end) that executes a series
of SQL statements to either create or alter tables.

I put some code in my Splash screens Open event to check to see whether one
of the new tables (or fields) exists in the backend database. If not, it
fires the subroutine that does all of the database structural changes. I'll
try to find some sample code to post from one of my applications.

HTH

--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Andreas said:
Hi Dale and Graham,

true, the backend contains only the tables BUT the database is in
Namibia and I am sitting in Germany. So if I have to add some fields
in a table (or create a new one) I should have the backend which is a
problem, as they can't use it there any more. So my idea is to have
the same structured backend here (without the data), write the changes
in a module in the frontend (find the differences with the program
CompareEM), send the frontend to Namibia with a nice button (which
copies the module with the changes in the backend there and would -
this is what i want to know from this posting - run the code in the
backend database there. The user would only have to click on the
button in the frondend. Sounds maybe a little bit complicated, but
would make it quite easy for the user to make the changes in the
backend.

Any ideas how to run the module in the backend with an command in the
frontend?

Thanks,

Andreas

Hi Andreas

It is unusual for a backend to contain anything except data tables. Is it
not possible to put thecodein your frontend?

Another way would be to call your function from a macro and use the Shell
command torunup another instance of Access and execute the macro from the
command line. The command line string for the Shell command would be
something like this:

"C:\Program Files\Microsoft Office\Office11\msaccess.exe"
"<path to your backend>" /x <name of your macro>

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand


I have a frontend and backend database. I have a nice tool to update/
create variables in the backend with VBA (compareEM). I copy thecode
to the backend with VBA.
Problem: Now I want torunthe module in the backend from the frontend
(so the user just clicks "update backend" and it will close the
frontend and runs the update-function in the backend).
Is that possible?
Thank you very much!
 
Hi Andreas

As Dale says, it is perfectly possible to run DAO in your frontend code
which adds or modifies tables/fields/relationships in your backend.

I usually have a custom database property in my backend which contains a
version number for the backend structure. (Another way is to store the value
in a linked table .)

When the frontend opens, after verifying the existence of (and if necessary,
locating) the backend, it checks the backend version. If it is lower than
what is required, code is executed to open the backend with DAO
(OpenDatabase) and perform the necessary upgrade. Then the tables are
linked and life proceeds as normal.
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Andreas said:
Hi Dale and Graham,

true, the backend contains only the tables BUT the database is in
Namibia and I am sitting in Germany. So if I have to add some fields
in a table (or create a new one) I should have the backend which is a
problem, as they can't use it there any more. So my idea is to have
the same structured backend here (without the data), write the changes
in a module in the frontend (find the differences with the program
CompareEM), send the frontend to Namibia with a nice button (which
copies the module with the changes in the backend there and would -
this is what i want to know from this posting - run the code in the
backend database there. The user would only have to click on the
button in the frondend. Sounds maybe a little bit complicated, but
would make it quite easy for the user to make the changes in the
backend.

Any ideas how to run the module in the backend with an command in the
frontend?

Thanks,

Andreas

Hi Andreas

It is unusual for a backend to contain anything except data tables. Is
it
not possible to put thecodein your frontend?

Another way would be to call your function from a macro and use the Shell
command torunup another instance of Access and execute the macro from the
command line. The command line string for the Shell command would be
something like this:

"C:\Program Files\Microsoft Office\Office11\msaccess.exe"
"<path to your backend>" /x <name of your macro>

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand


I have a frontend and backend database. I have a nice tool to update/
create variables in the backend with VBA (compareEM). I copy thecode
to the backend with VBA.
Problem: Now I want torunthe module in the backend from the frontend
(so the user just clicks "update backend" and it will close the
frontend and runs the update-function in the backend).
Is that possible?
Thank you very much!
 
Back
Top