Replicating a Database using Microsoft Access

Replicating a database using the Windows Briefcase

In this exercise, you will replicate the College.mdb database using the Windows 95 Briefcase component.
  1. From the Windows 95 desktop, double-click My Computer and locate College.mdb .
  2. Right-click College.mdb and click Properties .
  3. What is the current size of the database?
  4. Size the Ch06 window so you can see the Windows 95 desktop.
  5. Right-click the Windows 95 desktop and point to New , then click Briefcase .
  6. A new briefcase icon will appear on the desktop.
  7. From Ch06 , drag your database into the briefcase.
  8. When asked if you want to make your database replicable, click Yes .
  9. Click Yes to create a backup of the database.
  10. When prompted, choose the Original Copy to act as the Design Master, then click OK .
  11. On the Welcome to the Windows Briefcase dialog, click Finish .
  12. Double-click the Briefcase icon to verify a copy of the database has been placed in the briefcase.
  13. Switch to the Ch06 window.
  14. What is the size of the database now on your hard drive?
  15. Open your database and check your table for changes. Have there been any changes to table structure, new fields, new tables, etc.?

    Answers

* To change the Design Master

  1. Add a new text field to the Students table. Name the field EmailAddress . Were you allowed to make the change? Why or why not?
  2. Close this copy of the database and open the Replica copy in the briefcase.
  3. Select the Students table and click Open .
  4. The new field does not appear because the databases have not yet been synchronized.
  5. Close the Students table
  6. From the Tools menu, point to Replication and click Synchronize Now .
  7. Click OK to synchronize with the Design Master and the click Yes to re-open the database.
  8. Try to open the Students table in Design mode.
  9. Click Yes when prompted to open the table as read-only.

    Since this is a Replica, and not the Design Master, you cannot make changes to the table structure.

    Notice the new field has been replicated to this copy of the database.

    Answers

Replication with Data Access Objects (DAO)

The DAO programming interface provides methods and properties that you can use to implement several Briefcase replication features in your Microsoft Visual Basic code. You can use DAO to:
  • Convert a database to a Design Master.
  • Create and populate additional replicas.
  • Create and populate partial replicas.
  • Synchronize replicas.
  • Get and set specific properties of a replicated database.
  • Resolve conflicts and errors.
Although DAO requires programming, it allows you to customize your replication system. Generally, use DAO under the following circumstances:
  • Use event-based Replication if you need to synchronize replicas when certain events occur. For example, you may want to trigger synchronization whenever a replica receives updated product pricing from headquarters. You can use DAO to provide event-based replication.
  • Use simplified, or transparent, replication when you need to distribute your replicated database to users who have minimal computer expertise. In this case, you can use DAO to design a simplified replication interface or to make replication completely transparent to users.
  • Use partial replication when you need to create a replica that contains only a portion of the data. For example, you might use partial replication when you need to minimize the amount of disk space that you use or to maximize performance.


Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net