Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
Record Object
Recordset Object
METHOD: Record::CopyRecord
Implemented in version 2.5
CopyRecord
Source, Destination, UserName, Password, Options, Async
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.
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
CopyRecordOptionsEnum
constant that specifies the behavior of this method. The default is
adCopyUnspecified
.
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
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.
Code (VBScript):
objRecord.
CopyRecord
strSourceURL, strDestinationURL, , , adCopyOverWrite
...
objRecord.Close
...
objRecord.Open strDestinationURL
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information