VB6 FileCopy destination lock failure leaves restored data unverified
0 reputation · 24 Jun 2020, 09:01 UTC
When restoring application data files in a Visual Basic 6.0 environment, the intrinsic FileCopy statement fails if the destination is open, locked, or read-only, and it does not preserve original timestamps, attributes, or access-control metadata. The FileSystemObject.CopyFile method offers different overwrite rules and error surfacing, but neither approach declares a single preferred restore path, and VB6 provides no intrinsic file-hash or byte-comparison API to confirm that recovered bytes match the source.
Because a successful copy does not prove semantic validity or metadata fidelity, the choice between the two copy mechanisms remains an unresolved component-level decision. Behavior may also differ under VBA hosts or VB.NET, which use distinct file and security models.
Which copy mechanism should a VB6 backup restore use to balance error visibility and metadata preservation? How can recovered data be verified without an intrinsic hash or comparison API? Does the preferred restore path change when the target runs under a VBA host rather than the VB6 IDE?