List all the Forms and compare to another database

V

Victor Torres

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?
 
T

tina

well, since the FE db, by definition, should not store data, but only UI
objects, i wonder why you'd need to bother with a comparison. when you
change the master FE db, just deploy it to the users, overwriting their
existing FE dbs.

hth
 
A

Albert D. Kallal

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.
 
V

Victor Torres

WOW!!... I'm just amazed of the first page that you send me. Is that one of
your apps? Did you create it? How can I create the download process? I use
NSIS to deploy my database or FE, can I use this in the same way that you use
yours? And for last, can you please, please, pleaseeeee let me see some of
the codes to accomplish this??? Thanks a lot...

P.S. if this is possible, I can create a version tracker of the whole FE and
just let them know when an update is available.
 
A

Albert D. Kallal

Victor Torres said:
WOW!!... I'm just amazed of the first page that you send me. Is that one
of
your apps? Did you create it?

Yes, it 100% all access
How can I create the download process?

The download process simply uses my custom progress bar. I use that
progress bar in all kinds of code. There is a working copy of the
progress bar in my super easy word merge. You can find that
here:

http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
I use
NSIS to deploy my database or FE, can I use this in the same way that you
use
yours?

Yes, I use the free Inno installer. As mentioned, that runtime article has
an example
script. I not used NSIS, but it sounds like similar product to Inno, and as
long as
it produces a single .exe file that unzips and installs your front end, then
you most
certainly can use NSIS in place of Inno.
And for last, can you please, please, pleaseeeee let me see some of
the codes to accomplish this??? Thanks a lot...

There is a detailed discussion of what technologies I used here and how
handle my updating.:

http://www.utteraccess.com/forums/showflat.php?Cat=&Number=1806138&page=&view=&sb=5&o=&fpart=1&vc=1

Read the above....(when you get to the bottom, note there is a 2 page of
discussion...).

The above discussion covers most of your questions....
 
V

Victor Torres

I Albert. I'm sorry that I ask a lot. But also I'm learning a lot. I
already found out how to download a file from the internet using this next
code. What I can't do is create a progress bar so the person know that the
computer is not frezee because the file is more than 30Mb and MS access can't
do anything while is downloading the file. Is there anything I can do to
either make a progress bar or let the user use the database while is
downloading the file? Thanks

Declare Function URLDownloadToFile _
Lib "urlmon" _
Alias "URLDownloadToFileA" ( _
ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long _
) As Long

Function DownloadFile( _
URL As String, _
LocalFilename As String _
) As Boolean

Dim lngRetVal As Long

lngRetVal = _
URLDownloadToFile(0, URL, LocalFilename, 0, 0)
DownloadFile = (lngRetVal = 0)

End Function


To call the function is (Example of my nice little thinkingbar):

Call DownloadFile("http://www.vtronixcorp.com/download/Thinkingbar.zip",
"C:\Thinkingbar.zip")
 
A

Albert D. Kallal

Victor Torres said:
I Albert. I'm sorry that I ask a lot. But also I'm learning a lot. I
already found out how to download a file from the internet using this next
code. What I can't do is create a progress bar so the person know that
the
computer is not frezee because the file is more than 30Mb and MS access
can't
do anything while is downloading the file. Is there anything I can do to
either make a progress bar or let the user use the database while is
downloading the file? Thanks

Yes if you read that other link, I explain that you have to implement
callbacks in your download code....

There is a vb example here:

http://vbnet.mvps.org/index.html?code/internet/ftpdownloadcallback.htm

There is also the api's declared in the code example here, but not
implemented...
http://www.mvps.org/access/modules/mdl0037.htm

The above examples use the wininet.dll's, and that increases the complexity
of the code quite a bit because you have to setup the callbacks. (the above
callback example shows how to do this.

I would suggest you use this one, as it uses the built in progress box...
http://vbnet.mvps.org/index.html?code/internet/ftpdownloadcallback.htm
 
V

Victor Torres

Thanks Albert. I look at those site and the last one I believe that is what
I'm looking for but I'm not that good with vb. I try to copy and paste the
code but it give me a lot of errors. Anyway, I will keep looking to see if
someone has a working sample code that I can implement into my database.
Thanks...
 
V

Victor Torres

I manage to make it work. Now, I want to know if there anyway that I can
open a .exe and close my database so the update can take place.

Thanks..
 
A

Albert D. Kallal

Victor Torres said:
I manage to make it work. Now, I want to know if there anyway that I can
open a .exe and close my database so the update can take place.

Just download the .exe to a locaon on your disk drive.

then,

shell out to .exe
application.quit

Since the .exe is an Inno (or NISi) script, the user gets some prompts..and
you exited your access application....
 

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