[AccessD] AccessD Digest, Vol 84, Issue 18

Kenneth Ismert kismert at gmail.com
Sat Feb 13 13:18:13 CST 2010


>
> Shamil Salakhetdinov:
> <<<
> The rebuild was an extreme solution for
> an extreme problem, but it worked.
> >>>
> Hi Ken --
>
> Was that work code by code or manually?
>


It is a VBA code solution. The code:
 * Copies all Access objects from a source Access database to a
destination.
 * It recursively iterates the AllForms collection, creating all subform
dependencies before the parent form.
 * Uses a plug-in mechanism to handle various object creation methods,
including recreate from scratch, SaveAsText/LoadFromText, and
TransferDatabase. ImportXML and ExportXML could easily be added.
 * Has special handling for embedded ActiveX controls for which you have no
license.
 * Includes a restart function --- if the process errors out, you can
restart after the last good object that was copied

For each form, the recreate function loads the source form, and:
 * Creates a new, blank destination form
 * Creates the sections, copying all properties, including sorting/grouping
 * Orders all controls and tab page controls by tab order
 * Iterates through all controls, creating them in proper order in the
destination. Subcontrols are created under their parents
 * Iterates through the Properties collection of each control, copying them
to the destination control. This includes all hidden/outdated properties,
and properties that require custom handling.
 * Iterates through the controls in reverse z-order, sending controls to
front to so they render properly

It handles reports in a similar fashion. Modules and references are copied
by using VBA IDE methods.

It can copy/recreate about 98% of an Access database successfully. There
remains a lot of work to do on the code.

-Ken



More information about the AccessD mailing list