ADO » Record » MoveRecord

Version: 2.5

MoveRecord Source, Destination, UserName, Password, Options, Async
The optional Source parameter is a string that is the URL of the file or directory that is to be copied. If you do not provide a value or provide the empty string, the default value will be the file or directory where the referenced Record object resides.
The optional Destination parameter is a string that is the URL into which the file or directory is to be copied. The values of the Source and Destination parameters must be different, or a run-time error will occur.
The optional UserName parameter is a string that is the user name of a person who has authorization to access the destination locale.
The optional Password parameter is a string that is the password that authenticates the UserName parameter.
The optional Options parameter is a MoveRecordOptionsEnum constant that specifies the behavior of this method. The default is adMoveUnspecified.
The optional Async parameter is a Boolean value. If True, the operation can be asynchronous. If False, which is the default, the operation is synchronous.

Moves a file, or a directory and its contents, to a specified location.

The MoveRecord method is used to move a file or a directory and its contents from a source location to a destination location. In effect, the file or directory is deleted from its current location. If you want the file or directory to remain at the source location, you can use the CopyRecord method to relocate a copy to another location.

The default is not to overwrite any file or directory at the destination location and to update hypertext links in the files being moved, unless you specify otherwise in each case. Note that the ParentURL property is not automatically updated. You will need to close the Record and re-open it with the new URL. Likewise, you should close and re-open the Recordset object from which the Record was obtained to update the 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.

MoveRecordOptionsEnum Constants

Constant Value Description
adMoveAllowEmulation 4 If the attempt to move 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 move by using upload, download, and delete operations.
adMoveDontUpdateLinks 2 Does not update links of source Record
adMoveOverWrite 1 Allows files and directories at destination to be overwritten
adMoveUnspecified -1 Default, does not allow overwrite but does update links


objRecord.MoveRecord strSourceURL, strDestinationURL, , , adMoveOverWrite
objRecord.Open strDestinationURL

See Also: