Академический Документы
Профессиональный Документы
Культура Документы
Click on Split Database button and it opens the Save dialog window. Provide name for
back-end copy.
So "Task_Back-EndCopy.accdb" name is provided here for Tasks database. This back-
end database copy can be saved on a network to share among multi users and front –
copy can be available to each user separately at their own desktop.
When the confirmation message box shows, click the OK button.
Now take a look at the tables in the Navigation pane, which show small arrows at the
left side of the table names. This indicates that these three tables are now linked to the
Tasks database, and resides in the Back-end database.
So this way the front-end copy will have all forms, reports and queries (no tables). Data
changes made in the front-end copy will also update the back-end copy, which stores
only tables. Now add a new record to the Contact List, save and close the database.
If you open back-end copy of the database and select Contacts table. This new record
appears in the table.
This way all users work on the same database using their own front-end copy, and data
changes reflect in the back-end database. Split database architecture gives a look of
Client-Server database technology by storing database tables at back-end server and all
programming part such as forms, function, queries at front-end client side.
Access databases can link to older versions of Access database formats. So even if the
front-end database is in an Access ACCDB format, the linked back-end database can be
an MDB in Access 2000 or 2002-2003 formats or an ACCDB.
Select the table names which you want to update and click on Ok button. If you want to
link to a database located in another drive or folder, check the Always prompt for new
location box. This is common if you develop the front-end database on your local drive
with a local copy of your back-end database (to avoid testing on the live data), then
need to deploy it.
Always make sure that links are correct before you distribute them. It shows message
for successfully linking.
Relinking Tables Programmatically using VBA
You can also write some VBA module code to update a linked table (from our royalty-
free source code library Total Visual SourceBook):
tdfTmp.Connect = strNewConnect
tdfTmp.RefreshLink
ReLinkTable = True
PROC_EXIT:
dbsTmp.Close
Exit Function
PROC_ERR:
ReLinkTable = False
Resume PROC_EXIT
End Function
However, this code fails if the table is linked. This is very frustrating and many
developers resort to the FindFirst command instead. Unfortunately, FindFirst is very
inefficient. It does not use an index and performs a slow sequential search through the
entire table. This can be very painful for large tables. The good news is that you can use
Seek on linked tables. It’s a matter of properly identifying the database where the table
resides. Often, you will know the linked database name and you can easily set the
database variable (where strLinkedDB is the linked database name):
The example below is a general solution where the code tests a table and changes the
database variable if it is linked:
Your front-end database is now properly linked and ready for deployment across your
network.
Managing Front-End Databases on Each Desktop
With a split database design, you'll need to distribute the front-end database to each
user. By residing on their local machine, the performance of your application will
improve. However, this adds an extra level of complexity when your application
changes.
Knowing an Update Exists
If you have a new version of your front-end database, you'll need to replace each user's
database with the new one. This means your front end database needs to know what
version it is and not run if it's not the current one, and provide a mechanism to get an
update.
This can be easily done by adding a version table in the front-end database and the
back-end database. You manually update the table in the front-end database with its
version number when you create a new build. The back-end database contains the latest
version number. When the front-end database starts, it compares the two tables and
proceeds if the version is okay and stops if not. You'll then need a process to replace it.
Automating the Version Detection and Update Process
FMS offers a commercial software product, Total Access Startup, to simplify the
deployment of your Access applications. It lets you centrally manage each Access
application by identifying the master front end database, the location where it should be
installed on each user's desktop, and its version.
Rather than running the Access database directly, a shortcut is provided to each user so
the Total Access Startup program verifies the right version of Access is being launched
with the right version of your front-end database. If the current local database doesn't
exist or is out of sync, the latest version is installed on the user's desktop along with any
setup routines that are required. The process is seamless and you can easily change the
deployments centrally. Only one copy is needed to manage all the Access applications
across your network.
Additional Resources
Multi-user Microsoft Access applications are pretty important to your organization. FMS
offers additional resources designed for this environment:
Total Access Analyzer to help you create and diagnose your databases to find
errors, suggest enhancements, and improve performance.
Total Visual Agent to ensure your database maintenance tasks like database
backups and compacts are scheduled and executed. Can also launch processes on
a recurring basis.
Total Access Admin to monitor in real-time who’s entering and exiting in your
Access database.
Performance Tip
Significantly Improve the Performance of Microsoft Access Databases with Linked
Tables
Microsoft Resource
How to manually split a Microsoft Access database
Conclusion
Microsoft Access is a very powerful platform that lets you easily create solutions that can
significantly improve the productivity of your team. With a properly split database
architecture, you’ll find it even easier to create, enhance, and share your application.
Good luck!
Summary
For various reasons, you may decide to split the database into either a front-end application or
a back-end application. The back-end database contains the tables and is stored on a file server.
The front-end database that links to the back-end tables contains all the forms, the queries, the
reports, the macros, and the modules. The front-end database is distributed to the workstations
of the users.
This article describes how to split the database manually instead of by using the Database Splitter
utility.
More Information
To split the database in Microsoft Office Access 2003 and in earlier versions of Access,
follow these steps:
Notice that Access imports all of the tables into the new database, which is your back-end
database.
5. Store the new back-end database on a network share and make sure that all the users have full
permissions to the share.
6. Create a second new blank Access database.
7. On the File menu, point to Get External Data, and then click Link Tables.
8. Select the back-end database that you just created.
9. On the Tables tab, click Select All and then click OK.
Notice that Access links the tables in the back-end database to the front-end database.
10. On the File menu, point to Get External Data, and then click Import.
11. Select the original database that you are splitting, and then click Import.
12. On the Forms tab, click Select All. Repeat this step on all tabs except the Tables tab. Because
you have already linked to the tables, you now only need to import the rest of the objects.
13. After you have selected all of the objects except for tables, click OK.
Notice that you now have all the tables linked and have imported the remaining objects.
To split the database in Microsoft Office Access 2007, follow these steps:
3. In the Get External Data dialog box, click Browse to locate and select the database that you
want to split, click to select the Import tables, queries, forms, reports, macros, and
modules into the current database. check box, and then click OK.
4. In the Import Objects dialog box, click Select All on the Tables tab, and then click OK.
Notice that Access imports all of the tables into the new database, which is your back-end
database.
5. Store the new back-end database on a network share, and make sure that all the users have
full permissions to the share.
8. In the Get External Data dialog box, click Browse to select the back-end database that you
created, click to select the Link to the data source by creating a linked table. check box,
and then click OK.
9. In the Import Objects dialog box, click Select All on the Tables tab, and then click OK.
Notice that Access links the tables in the back-end database to the front-end database.
12. In the Import Objects dialog box, click Select All on the Forms tab, repeat this step on all
other tabs except the Tables tab because you have already linked to the tables. You now only
need to import the rest of the objects, and then click OK.
Notice that you now have all the tables linked and have imported the remaining objects.
Notes
This database is the front-end database. You can distribute this front-end database to the
workstations so that each user has his own copy of the front-end database.
You have now successfully split your database, which will improve performance. Now when
a user opens a form, the form opens locally on their computer, and is not sent across the
network. The only data that comes across the network is the data in the linked tables.
You have several people developing in the database and you do not have Microsoft Visual
Source Safe installed.
You do not want your users to be able to make design changes to tables.
The most common reason to split a database is that you are sharing the database with multiple
users on a network. If you simply store the database on a network share, when your users open
a form, query, macro, module, or report, these objects have to be sent across the network to
each individual who uses the database. If you split the database, each user has their own copy
of the forms, queries, macros, modules, and reports. Therefore, the only data that must be sent
across the network is the data in the tables.
Note To split the database, you can also use the Database Splitter utility.
SIGNIFICANTLY IMPROVE THE PERFORMANCE OF
MICROSOFT ACCESS DATABASES WITH LINKED
TABLES
A Split Microsoft Access Database Architecture Offers Many
Advantages
A split database architecture is best for developing, maintaining, and deploying Microsoft
Access applications. The front-end database contains all the Access objects except the
tables which reside in a separate back-end Access Jet database. The front-end database
links to the tables in the back-end database, so it can be updated without worrying
about changes to the data.
Dim x As Integer
Dim strName As String
Dim strMsg As String
' List of databases kept in a static array so we can close them later
Static dbsOpen() As DAO.Database
If pfInit Then
ReDim dbsOpen(1 To cintMaxDatabases)
For x = 1 To cintMaxDatabases
' Specify your back end databases
Select Case x
Case 1:
strName = "H:\folder\Backend1.mdb"
Case 2:
strName = "H:\folder\Backend2.mdb"
End Select
strMsg = ""
On Error GoTo 0
If strMsg <> "" Then
MsgBox strMsg
Exit For
End If
Next x
Else
On Error Resume Next
For x = 1 To cintMaxDatabases
dbsOpen(x).Close
Next x
End If
End Sub
OpenAllDatabases True
OpenAllDatabases False
For instance, if you have a form that controls the application and remains open during
the entire time the user is using your database, add the code to the OnOpen and
OnClose events.
This simple technique yields considerable performance gains.
Additional Resources
Microsoft Access Best Practices: Finding Errors, Suggestions, and Performance Tips
in Your Databases with Total Access Analyzer
Source code for Starting Microsoft Access databases in Total Visual SourceBook
Module class for Managing Microsoft Access Linked Tables and Databases in Total
Visual SourceBook
Splitting Microsoft Access Databases to Improve Performance and Simplify
Maintainability
100+ Microsoft Access Performance Tips to Speed up Your Access Databases
More tips
Good luck!