Replace Front End DB With Another Database

johnnyc

Registered User.
Local time
Today, 07:06
Joined
Sep 23, 2014
Messages
26
I have a split database. When the front end db is updated, i am attempting to delete the end users copy and replace with the updated version.

I have gotten as far as being able to open Database A, Open Database B with A and Close Database A, but it will not let me delete Database A from B because the procedure originated from Database A.

Please help!!

Johnnyc
 
I have a procedure posted HERE that you can look at - basically, you create and execute a script, and then close the active front end.
 
worked thanks!
 
Last edited:
Sorry to hijack this, but it is a solution I have been after for quite some time.

I am having an issue with the batch file. This is how the operation goes:

1) I open the database, it warns me to update
2) Database closes, deletes the local file
3) I can see the new file get copied
4) An error comes up "Windows cannot find the file c:\Programs Database developement.accdb" even though I can see the file get created.
5) Click "OK" on the error message
6) File that was there gets deleted.

Any ideas?

Im guessing this is the part of the batch file that is failing for me:


ECHO Starting Microsoft Access...
START /I "MSAccess.exe" "C:\Programs Database _Development.accdb"
 
Alright, I moved my master FE and BE to my local drive and it works. Any idea why I can't copy the master database FE from the network to a local PC? I have full permissions for that network drive.
 
Not offhand, no. My first suggestion would be to step through the code and find the exact line where the program is failing. That would at least let me know what it's trying to do and precisely which data it's trying to access.

If it's happening when the new version is being opened, I'd check the file name being saved to the batch file.
 
So I got this to work...sort of. I can have the database delete itself, copy the new one and open up, but I get stuck in an endless loop. I think my confusion lies in the method of releasing a new FE, and where and when to update the version numbers in the linked table and the new local table.

Currently, I have a BE that all users FE's are linked to. I have a developement FE where I obviously perform my updates. When the updated FE is ready for release, I copy it onto a network location. Would I put the new version number in the table in my new FE, and have the same version number in my linked BE? If I do it this way, my users would have a previous version number on their local drives, and a new version number on the linked BE table, which would trigger the update. Once the update was run, the new FE gets copied over and the version #'s in the FE and BE are now the same.

Does this sound right? The reason I ask is because I did a test and ended up in the delete/update loop.
 
Delete/Update loop happens when the newly installed front end's version number doesn't match the master version number (which from the above sounds like you're storing it in your back end). Make sure they're identical, and that you're actually installing the correct front end. (I had it installing my dev copy once rather than the release version. Oops!)
 
Sorry to hijack this, but it is a solution I have been after for quite some time.

I am having an issue with the batch file. This is how the operation goes:

1) I open the database, it warns me to update
2) Database closes, deletes the local file
3) I can see the new file get copied
4) An error comes up "Windows cannot find the file c:\Programs Database developement.accdb" even though I can see the file get created.
5) Click "OK" on the error message
6) File that was there gets deleted.

Any ideas?

Im guessing this is the part of the batch file that is failing for me:


ECHO Starting Microsoft Access...
START /I "MSAccess.exe" "C:\Programs Database _Development.accdb"


The FE update code I see most people use is either Bob Larson's or a derivative thereof, like what was posted. I too had my working file deleted long ago.

I started with Bob's method and combined all of it into one function/sub. I added a small If statement to mine to skip the whole update process if the extension of the file name being used ends in "db". I only release accde or mde files for use. There is no need for the front end update utility to run if you are using your development copy.
 
Yeah, that wasn't an option when I had the issue I mentioned. Policy from above - no accde/mde files. Didn't make sense to me, but it wasn't a place where I could get away with calling my boss an idiot.

Edit: Also, that's Larson's code? Good to know; I found the code I used as a foundation on StackOverflow (IIRC), and it wasn't attributed.
 
Edit: Also, that's Larson's code? Good to know; I found the code I used as a foundation on StackOverflow (IIRC), and it wasn't attributed.

Yes, that's Bob's code. I tried linking to his website to show the file but I am getting an error.

I made quite a few changes to it but the very first thing I do is look at the extension and skip the whole thing if its not an accde or mde.
 

Users who are viewing this thread

Back
Top Bottom