Version: 2.5
Copies a file, or a directory and its contents, to a specified location.
The CopyRecord method is used to copy a file or a directory and its contents from
a source location to a destination location.
The default is to not allow over write or recursive copy.
If you do specify recursion, the destination location may not be a subdirectory of
the source location.
This method will return a string value that is usually the value of the
Destination parameter, but the exact value that is returned is provider-dependent.
There are six optional parameters.
CopyRecordOptionsEnum Constants
Constant | Value | Description |
---|---|---|
adCopyAllowEmulation | 4 | If the attempt to copy the records failed, because the Destination is on a different server or uses a different provider than the Source, then the Source provider can attempt to simulate the copy by using upload, download, and delete operations. |
adCopyNonRecursive | 2 | Copies the directory, but not any subdirectories |
adCopyOverWrite | 1 | Can overwrite existing file or directory at destination |
adCopyUnspecified | -1 | Default, does not allow overwrite or recursive copy |
objRecord.CopyRecord strSourceURL, strDestinationURL, , , adCopyOverWrite
...
objRecord.Close
...
objRecord.Open strDestinationURL