Splitting database

bilakos93

Member
Local time
Today, 18:15
Joined
Aug 25, 2023
Messages
36
Hello

I have created a database which is split (front end/back end). I've also created an accde version which I have distributed. I have kept the accdb file.
I now want to make further changes/small improvements (such as adding some vba code, updating colours etc) on the front end.
I assume I make the changes on the accdb file, then save it as accde and then distribute this? How do I link my new accde file with the original back end file?

Thank you
 
Why not the same way you did when you did the original distribution?
 
because there have been new data since then on the back end file?
Am I missing something obvious?
 
new records on existing tables
No issue then. That is the whole idea of a split DB. Just give them another accde.
There are two main methods.

1. Users use a shortcut and download a new accde each time.
2. The DB checks the version, and if a new one exists, advises the user, copies the new accde and then opens it again.

Search on here for both ways. it has been asked many times.
 
So the steps are
- make updates on the accdb file
- split it
- delete the back end file
- keep the accdb
- create an accde from the new accdb
- distribute the new accde

Right?
 
So the steps are
- make updates on the accdb file
- split it
- delete the back end file
- keep the accdb
- create an accde from the new accdb
- distribute the new accde

Right?
Actually, the steps were:
1. Split the ACCDB into FE & BE
2. Make a ACCDE from the FE
3. Put the BE on a network share
4. Distribute the ACCDE to all users
5. Make design changes to the ACCDB FE
6. Make a new ACCDE
7. Replace users' old ACCDE with the new one
 
So the steps are
- make updates on the accdb file
- split it
- delete the back end file
- keep the accdb
- create an accde from the new accdb
- distribute the new accde

Right?

The accdb file you modify should be the one you saved after you split the database originally (i.e., the front-end application).

If you did not do this, then yes, you would need to split the database again and discard the back-end file. But this time, save your front-end accdb file so that you can update it and redistribute it in the future.
 
I assume I make the changes on the accdb file, then save it as accde and then distribute this? How do I link my new accde file with the original back end file?
Your test version of the application should always be linked to a test version of the BE. When you have completed all your changes and tested them and are ready to move the FE into production, you create the .accde and use the linked tables manager to relink to the production BE in the .accde version. Do the relinking in the new .accde for safety. You don't want to accidentally have your test FE linked to the production BE because if you forget, then you will be testing with production data and that would be seriously bad for everyone. After the relink, move the .accde (renamed as .accdr for one tiny level more security) to the master folder on the server where the distribution copy lives.

I have a relinker I built long ago because the old version just didn't work safely for FE's that link to multiple BE's. Today's version is still not great but it is a lot better and unless you really want your own relinker (there are several posted that are slightly different), no need to bother.
 
Last edited:
If you do a split or not, a cardinal rule with an "ongoing" DB is to always keep extra copies. Keep GOOD backups. Another one of those copies will be your "working copy" that you use for future upgrades, new features, fixes, etc. IF you have a split DB, it is not uncommon to take a working copy of the back-end file and use that for your working copy for testing. (See detailed suggestions below.) Besides the working copy, you ALWAYS make backup copies of anything you are about to replace so that if things go 💥 you can quickly revert - and later, you can look at the backup if you were unsure about what you did. An important fact to remember: Access does what it does to link to a shared back-end using file names. A file might have some complex internal identifier, but Access doesn't use that. It uses the full file specification: DEV:/path/name.type - and that's all.

In the case of a non-split database with "live" data where you are getting ready to share, you need to split right away, perhaps before you share, due to issues that arise in conflicting file locking, which can lead to database corruption VERY quickly. But you said you split it, so you won't run into that particular problem. I mentioned it so you would understand that a split DB is a GOOD choice when sharing the app.

In the specific case where you have a split DB and the back-end is being shared, the issue of updating the FE is multi-step, but not that tedious.

1. Make a copy of the front-end that everyone is using. Using the the external data tools from the ribbon, point this copy of the FE file to the copy of the BE file in the working area. (IF you don't have a BE copy in the working area, make one NOW, before you do any work on the FE.) The "working area" FE copy always points to the working area copy of the back-end file.
2. Modify the FE copy with your upgrades & fixes. When the working copy is as you want it, copy that file to a separate staging area. You do this so that the "working" copy of the FE continues to point to the working copy of the BE file.
3. Using the external data tools from the ribbon on the staging-area copy, update this FE to point to the shared "live" back-end file.
4. NOW you can create the .MDE/.ACCDE file to be distributed in the staging area.
5. Make a backup copy of the FE file that is about to become obsolete.
6. Place the new FE file in the folder where your user will copy it or from which you will distribute it.
7. (A non-step) The BE file never has to be touched as long as you have made no structural changes. You don't care whether there were data changes while you were working anyway. The DB doesn't have to "go down."

Now, it IS possible that you want to update something structural in the BE file. That is more difficult because you have live data to preserve in that back-end file. So you set up a time when your users know the DB will be out of service. When that time comes, verify that you have no lock files open (.LDB or .LACCDB) in the folder where the BE resides. If necessary, visit the users while carrying an ugly medieval weapon to persuade them to drop out of the DB. (Some users are unusually insistent that they really need to keep working...)

1. When you know that all users are out of the DB, copy that BE file immediately to your working area. Then RENAME the shared copy of the BE file in the shared area. Since Access works by file names, this effectively turns off the DB hard. In this context, your emergency backup is the renamed copy.
2. With the working BE in the work area, open it directly and make your structural changes. IF you ALSO need to update the front-end file, do these changes simultaneously, working from the work area.
3. Whether or not there were FE changes, using the working FE copy (in the work area) and the external data tools from the ribbon to direct the test copy to the copy of the BE file. Test it. IF the FE was also changed, you would have also updated the FE file, so that is the version for testing.
4. When all of it works as expected, finalize any actions in the updated BE file. IF the FE was also modified, finalize it. However, there is a minor wrinkle in this case since you have to update the links from FE to BE before you create the .MDE/.ACCDE file.
5. Move this copy of the BE to the area where it normally resides under the name that the DB expects to see. Note that at the moment the file with the right name for the BE file appears in that folder, the DB is open again. THEN redirect the links in the FE and make the .MDE/.ACCDE file. Move that new FE file to the distribution folder.
6. Move the BE copy you renamed earlier to the folder you use for backups and rename it according to your backup standards.

Seems like a lot, but I can tell you that this method worked for me in a fairly exacting environment - the U.S. Navy - on a "For Official Use Only" site.
 

Users who are viewing this thread

Back
Top Bottom