Close Method
Connection Open Method
Record Open Method
Recordset Open Method
METHOD: Stream::Open
Implemented in version 2.5
streamobject.
Open
Source, Mode, OpenOptions, UserName, Password
The
Open
method is called to open a
Stream
object. While the
Open
operation is occurring, you temporarily cannot set any properties until the open is completed. Remember, prior to opening a
Stream
, you can access the various read-only properties and obtain values.
There are five optional parameters.
The optional
Source
parameter is a variant that indicates the source of the data for the
Stream
object. This can be a URL or a reference to an already opened
Record
object. If you do not specify a source, a new
Stream
will be created and opened. It will have a
Size
of zero and will contain no data since it will not be associated with any underlying source.
The optional
Mode
parameter is one of the
ConnectModeEnum
constants that dictate the access permissions for a
Stream
object. If the
Source
parameter is an already opened
Record
object, this parameter will be implicitly set.
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:
1.
adModeShareDenyRead
,
2. or
adModeShareDenyWrite,
3. or
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
OpenOptions
parameter is a
StreamOpenOptionsEnum
constant that specifies possible options for opening a
Stream
object.
StreamOpenOptionsEnum Constants
Constant
Value
Description
adOpenStreamAsync
1
Open in an asynchronous mode
adOpenStreamFromRecord
4
Already opened
Record
adOpenStreamUnspecified
-1
Use the default
The optional
UserName
parameter is a string containing the name of a user who can access the
Stream
object. If the
Source
parameter is an already opened
Record
, neither the
UserName
nor the
Password
parameter is used.
The optional
Password
parameter is a string containing the password that validates the
UserName
parameter. If the
Source
parameter is an already opened
Record
, neither the
UserName
nor the
Password
parameter is used.
Code (VBScript):
objStream.
Open
rsGuruData, adModeReadWrite
objStream.Position = 0
...
objStream.Close
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information