METHOD: Record::Open

Implemented in version 2.5

recordobject.Open Source, ActiveConnection, Mode, CreateOptions, Options, UserName, Password

The Open method is used to open an existing Record object or to create a new file or directory.

There are seven optional parameters.

The optional Source parameter is a variant that is the absolute or relative URL of the entity represented by the Record, or it is a row of a Recordset object that is open.

The optional ActiveConnection parameter is a variant that is the connection string or an open Connection object which specifies the file or directory that the Record object will be applied. If this property is not specified and Source is an absolute URL, then a Connection object is implicitly created using Source. If Source is a relative URL, then ActiveConnection must contain a Connection object, an absolute URL, or a Record that represents a directory.

The optional Mode parameter is one or more of the ConnectModeEnum constants that declare the mode for the Record. The default is adModeUnknown.

ConnectModeEnum Constants

Constant Value Description
adModeRead 1 Read-only permission
adModeReadWrite 3 Read/write permission
adModeRecursive 0x400000 Sets permissions for children of the Record. Must use with either adModeShareDenyRead or adModeShareDenyWrite. Or must use with adModeShareDenyNone plus any one of adModeRead, adModeReadWrite, or adModeWrite
adModeShareDenyNone 16 Other users can open a connection with all permissions
adModeShareDenyRead 4 No other user can open a connection with read permission
adModeShareDenyWrite 8 No other user can open a connection with write permission
adModeShareExclusive 12 No other user can open a connection
adModeUnknown 0 Default, permission not set or determined
adModeWrite 2 Write-only permissions


The optional CreateOptions parameter is one or more of the RecordCreateOptionsEnum constants that specify whether to open an existing Record or to create a new one. The default is adFailIfNotExists.

RecordCreateOptionsEnum Constants

Constant Value Description
adCreateCollection 0x2000 Create a new Record specified by Source parameter
adCreateNonCollection 0 Create a new Record of type adSimpleRecord
adCreateOverwrite 0x4000000 Allows overwrite of existing Record
. You must OR this constant with adCreateCollection, adCreateNonCollection, or adCreateStructDoc
adCreateStructDoc 0x80000000 Create a new Record of type adStructDoc
adFailIfNotExists -1 Default
adOpenIfExists 0x2000000 Provider must open existing Record
. You must OR this constant with adCreateCollection, adCreateNonCollection, or adCreateStructDoc

 
The optional Options parameter is one or more of the RecordOpenOptionsEnum constants that specify the options for opening a Record object. The default is adOpenRecordUnspecified.

RecordOpenOptionsEnum Constants

Constant Value Description
adDelayFetchField 0x8000 Retrieve fields associated with Record only when needed
adDelayFetchStream 0x4000 Retrieve stream associated with Record only when needed
adOpenAsync 0x1000 Open in an asynchronous mode
adOpenRecordUnspecified -1 Default, no options selected
adOpenSource 0x800000 Opens source of executable script


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.

Code (VBScript):
Set objRecord = Server.CreateObject("ADODB.Record")
objRecord.ActiveConnection = strConnection
...
objRecord.Open strSourceURL
Or
Set objRecord = Server.CreateObject("ADODB.Record")
...
objRecord.Open strSourceURL, strConnection

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information