Victor Torres said:
Hi to all, This is a very nice question and I know that the auto fe wil
work
but I need to go beyond. I have my master FE database and all the FE that
are in laptops. I all ready found out that you can import forms from
another
database. What would be the best way to compare both database and delete
and
import only the new or changed forms?
I think the amount of code and testing you'd have to do to make the above
process work a would actually cost too much in terms of development time.
What happens if you import a form that calls some code form a code module,
and you forget to import that code module? How can you keep track of what
relies on what and what code calls other code?
Furthermore when you import a form with code in it, you cause the database
to become un compiled. That means you really need to recompile your code
again "after" the importing. This type of importaing also causes a lot of
bloat (you'll have to delete the former report before you actually execute
the import).
What happens if you delete a form, and then the import process craps out?
Now you have some forms replaced, and some forms of not yet replaced, and
some that might not copied? This type of process gets fairly messy than
fairly unreliable quickly.
In fact the best and safe way here is to ALWAYS to distribute a mde. A mde
means that your code always remains in a compiled state. A mde means when
you click on a form there is no possibility of some code that needs to be
recompiled. In fact, because debugging code and other pieces of code are
actually removed when you compile a mdb to a mde they are smaller, and can
have some performance increases.
Perhaps the best reason to always distribute an mde is any un handled errors
in your vba code means that your variables are not reset. This means EVEN
code that does not have a error handling and has an error will not cause the
values of your variables to be re-set. I don't think I have to spend a lot
of time explaining that an application in which the values of the variables
NEVER reset will increase the reliability of your app by an significant
amount. So, you should be distributing a mde to your users, not a mdb
anyway.
Another additional bonus of using mde files is your users can't modify the
code or forms or reports, and this keeps prying eyes out of your code.
I wish I could come up with some kind of workable way to import bits and
pieces and parts of the application.
On the other hand what would you really save in terms of download size by
import bits and pieces? I have an application with over 160 forms, probably
that many reports and queries, and over 30,000 lines of vba code. The
resulting in mde file is what, about 6 megs in size? This then can be zipped
down to less then 2MB in size. In fact that application with 160 forms still
fits on a 1.44 3.5 inch floppy as a zipped up a file.
Since such a complex access application can be zipped into such a small
little tiny file, the amount of effort and time take it to try to import
individual forms is simply not worth it anymore..
On any type of high speed Internet, my customers can upgrade their
applications by me providing a complete new copy of the front end in less
then about 15 secionds of time form a web Site. Here's a screen a series
shots of how my customers upgrade my access application:
http://www.kallal.ca/ridestutorialp/upgrade.html
To create the above upgrade process, I simply place a copy of the new
"whole" application on at a web server. I hen execute a line of code in
access to download and install it. The code that produces the above donwload
+ install is:
application.FollowHyperlink
www.mywebsite/pathName to .exe file
application.Quit
So, just TWO simple lines of code to make the upgrade...
So, 'd simply just place the front end inside of a inno script (that's how
the above works". I have an example article and even an example install
(inno) script you can use for your installs outlined here:
http://www.members.shaw.ca/AlbertKallal/RunTime/Index.html
While the above pertains to upgrading access 2007 applications in the access
2007 runtime, the advice and sample script can be modified and used for any
version of access you have.