Chapter Summary

In this chapter, you learned how to secure a Microsoft Office Access database from VBA procedures by using various objects and methods that are available in the ADOX and JRO object libraries. You practiced creating and modifying user and group accounts for a sample database, and granted and revoked permissions on objects. You also learned how to secure an Access database with a password and wrote a VBA procedure that encrypts the entire database.

In the next chapter, you discover how you can make the database available to users in remote locations via database replication.

Database Replication

To make your database available to users in various geographical locations, you can provide them with a full or partial copy of the database. Mobile or remote users can maintain a local copy of a database, make changes to data offline, and synchronize with the main database on a regular basis. All this can be achieved via the technology known as database replication. When you replicate a database you simply create multiple copies (replicas) of your application and distribute them to users in remote locations so that they can easily share the changes they are making to a database. Database replication also offers other advantages, such as:

Convenient distribution of updates to existing applications — Changes made to queries, forms, reports, and other application components can be automatically updated in remote copies of the database during the next synchronization.

Reduction of network traffic — Database replicas can be placed on different servers serving different groups of users, thus reducing the network load.

Data backup — You don't need to make a separate backup copy of your database as each member of the replica set can serve as a backup. If the Design Master is corrupted, you can always make another member of the replica set the Design Master. You learn about creating the Design Master and replicas later in this chapter.

Although you can create a replica of your database via the Microsoft Office Access 2003 user interface (see the Replication command in the Tools menu), in the following sections of this chapter, you will learn how to perform the replication tasks by using ADO.

Before beginning your experiments with database replication by writing code, set a reference to the Microsoft Jet and Replication Objects Library (JRO) by choosing Tools | References in the Microsoft Visual Basic Editor screen.

Part II

Figure 18-1: After setting the reference to the Microsoft Jet and Replication Objects Library (JRO) you can use the Object Browser to view available objects, properties, and methods.

The Replica object has methods for determining if an object is replicable (GetObjectReplicability method), creating a replica (CreateReplica method), converting a database to a Design Master (MakeReplicable method), populating a partial replica (PopulatePartial method), setting an object's replicability (SetObjectReplicability method), and synchronizing replicas (Synchronize method). In addition to methods, there are quite a few Replica properties that allow you to set or retrieve various characteristics such as DesignMasterId, ReplicaId, Visibility, RetentionPeriod, and ConflictTables. The VBA procedures in this section will give you a head start in database replication.

^^ Note: This chapter requires that you complete all hands-on exercises in order.

0 0

Post a comment