Execute Method
Connection Object
Record ActiveConnection Property
Recordset ActiveConnection Property
PROPERTY: Command::ActiveConnection
Set
connectionobject
=
commandobject.
ActiveConnection
Set
commandobject.
ActiveConnection
=
connectionobject
commandobject.
ActiveConnection
= string
string =
commandobject.
ActiveConnection
The
ActiveConnection
property is used to indicate the specific
Connection
object with which the
Command
object is to be associated and will use for execution. If the connection is closed, this property sets or returns a string that contains the definitions for the connection. If the connection is open, this property sets or returns a variant that is the
Connection
object to which the
Command
object is currently assigned. The default is a null object reference.
If you
Set
this property to a closed
Connection
object, an error will be generated. An error will also occur if you try to call the
Execute
method of the
Command
object before the connection is open.
If you close the
Connection
that is associated with a
Command
object, the
ActiveConnection
property will be set to
Nothing
.
If you set this property to
Nothing
, the
Command
object is disassociated from the
Connection
object. Note that both the
Command
and
Connection
objects will continue to exist. As long as both objects exist, you can use the
ActiveConnection
property to reset the same association, or set a new association between the
Command
object and another
Connection
object.
Code (VBScript):
Set objCommand.
ActiveConnection
=
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=ADOData.mdb"
or
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=ADOData.mdb"
Set objCommand.
ActiveConnection
= objConnecion
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information