| ActivePatch Developer's Guide - Applying Patch Files | ||
|
The process of applying the patch file uses the contents of a previously created patch
to modify the original version of a file to produce the modified version. Using the same
example that created the patch file, we'll copy the ' Apply a patch file, creating the updated version of ' a file from the original version PatchFile1.FileName = "house.pat" PatchFile1.Password = "secret" PatchFile1.Options = apBackupFile Or apIgnoreFileTime On Error Goto CreateFailed PatchFile1.Apply "house.mdb" Exit Sub CreateFailed: MsgBox Err.Description Exit Sub The FileName property specifies the name of the patch file to apply against the original version of the file. The Password property specifies the password that was used to secure the patch file when it was created. The Options property specifies the options to be used when applying the patch.
In this case, there are two options which are used. The first option that is specified,
The second option specifies that the time that the file was last modified should be
ignored when determining if the patch can be applied safely to the file. By default, the Apply
method has a very stringent set of criteria to determine that the original version of the
file has not been changed in any way; the Because only one parameter was passed to the Apply method, this tells the control that you wish to overwrite the original version of the file with the updated version. In this example, before the method is called, the file house.mdb is identical to the original version of the database, house1.mdb. After the method successfully returns, house.mdb will be identical to house2.mdb, the updated version of the database. If an error occurs during the creation of the patch file, the error trap is triggered. In this case, a description of the error is displayed and the subroutine exits. |
||