<html>
<head>
<title>Connection Object </title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="Description">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">Connection Object </td>
<td valign="top" class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description">
<synopsis>
Dim <span class="replaceable">connection</span> As ADODB.Connection</synopsis>


<p>A Connection object represents a unique connection to a data source.
Connection objects are independent of all other ADO objects.</p>

</td></tr>
</table>
</div>
<div id="Connection.Attributes">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.Attributes Property </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">Connection.Attributes</span> = XactArgumentsEnum [+ XactArgumentsEnum...]</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The Attributes property is used to set or return specific
characteristics about the Connection object.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>XactArgumentsEnum (Long)</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The Attributes property is read- and write-enabled. The value of the
Attributes property can be set to any sum of the XactArgumentsEnum
enumeration values, listed in <link linkend="ado-APP-E">Appendix E</link>.</p>


<p>The default value of the Attributes property is zero.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Note</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Not all providers support the functionality of the Attributes
property.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.BeginTrans Method, Connection.CommitTrans Method,
Connection.RollBackTrans Method, XactAttributeEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.BeginTrans">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.BeginTrans Method</td>
<td class="COMPATIBILITY">CBT Method(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.BeginTrans<br><span class="replaceable">level = connection</span>.BeginTrans(  )<br><span class="replaceable">connection</span>.CommitTrans<br><span class="replaceable">connection</span>.RollbackTrans</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The BeginTrans, CommitTrans, and RollbackTrans methods are used to
manage transaction processing for the current Connection object.</p>


<p>The BeginTrans method begins a transaction, as you might expect.</p>


<p>The CommitTrans method ends the current transaction, while first
saving any changes and then possibly starting another transaction
altogether.</p>


<p>The RollbackTrans method ends the current transaction, but rolls back
any changes made during the current transaction. In addition, the
RollbackTrans method can start another transaction, just as the
CommitTrans method can.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The BeginTrans, CommitTrans, and RollbackTrans methods of the
Connection object perform transaction management within a particular
connection. The most common example of a need for transaction
management is a banking system. When you transfer money from one
account to another, it is important that the two steps involved (a
withdraw followed by a deposit) occur as a single transaction. By
using these three transaction-management methods, we can ensure that
both or none (but not either alone) of the bank steps are performed.
If there is a problem with the deposit after the withdraw has
completed, we can in effect roll back time with the RollbackTrans
method.</p>


<p>The BeginTrans method begins a new transaction within the current
Connection object. By using the BeginTrans method, you can create
nested transactions much like you can create nested If . . . Then
statements in your code. A return value can be received from the
BeginTrans method in the form of a Long, if the data provider
supports nested transactions. This return value indicates the level
of the nested transaction that was created, one being the first.</p>


<p>The CommitTrans method commits any changes since the beginning of the
last transaction. While the RollbackTrans method performs the
opposite, it cancels any changes made to the last transaction. In
both cases, the last transaction is ended. In addition, the last
transaction created must end before either the CommitTrans or
RollbackTrans methods can end an earlier transaction.</p>


<p>If the Arguments property of the Connection object is set to
<span class="LITERAL">adXactCommitRetaining</span>, a new transaction is
automatically created after a CommitTrans method call. If this
property is set to <span class="LITERAL">adXactAbortRetaining</span>, a new
transaction is created automatically after a RollbackTrans method
call.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.Arguments Property</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.BeginTransComplete">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.BeginTransComplete Event </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Private Sub BeginTransComplete(ByVal <span class="replaceable">TransactionLevel</span> As Long, _<br>                               ByVal <span class="replaceable">pError</span> As ADODB.Error, _<br>                               <span class="replaceable">adStatus</span> As ADODB.EventStatusEnum, _<br>                               ByVal <span class="replaceable">pConnection</span> As ADODB.Connection)</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The BeginTransComplete event is raised after the BeginTrans method
has completed its operation.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">TransactionLevel</span></dt>
<dd><p>A Long value indicating the nesting level of the new transaction.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pError</span></dt>
<dd><p>An Error object containing details about an error that occurred if
the <span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">adStatus</span></dt>
<dd><p>An EventStatusEnum value indicating the status of the current
operation. If the <span class="replaceable">adStatus</span> parameter is
set to <span class="LITERAL">adStatusOK</span>, the operation was successful.
If the <span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>, the operation failed, and
the <span class="replaceable">pError</span> object contains the details
regarding the error. By setting the
<span class="replaceable">adStatus</span> parameter to
<span class="LITERAL">adStatusUnwantedEvent</span>, this event will not be
called again.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pConnection</span></dt>
<dd><p>The Connection object that fired this event.</p></dd>

</dl>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.BeginTrans Method, Connection.CommitTransComplete Event,
Connection.RollbackTransComplete Event, EventStatusEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.Cancel">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.Cancel Method </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.Cancel</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The Cancel method cancels the pending asynchronous connection or
execution.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>If the Execute or Open methods of a Connection object where called
with the <span class="LITERAL">adAsyncConnect</span>,
<span class="LITERAL">adAsyncExecute</span>, or <span class="LITERAL">adAsyncFetch</span>
options, the Cancel method will cancel the pending asynchronous
operation.</p>


<p>If the Cancel method is called for an operation that was not executed
with the <span class="LITERAL">adAsyncExecute</span> option set, an error will
occur.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.Execute Method, Connection.Open Method</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.Close">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.Close Method </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.Close</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The Close method is used to close either a Connection or Recordset
object, including any dependent objects that they may have.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The Close method terminates a connection with a data source. After a
Connection object is closed, properties can be adjusted, and the
object can be opened again. Calling methods that require a connection
while the Connection object is closed generates an error.</p>


<p>Closing a Connection object that one or more Recordset objects were
created from causes those Recordset objects to close as well. All
pending changes are lost. If there is a pending transaction, an error
occurs.</p>


<p>Closing a Connection object does not remove it from memory, it only
frees the resources that it is using. To remove the Connection object
from memory in Visual Basic, set it to <span class="LITERAL">Nothing</span>.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.CommandTimeout">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.CommandTimeout Property </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.CommandTimeout = <span class="replaceable">timeout</span></td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The CommandTimeout property indicates how long ADO waits before it
generates an error when executing a particular command.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Long</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The CommandTimeout property is read- and write-enabled. By using the
CommandTimeout property, you can specify how long ADO will wait for a
command to execute. The setting for the CommandTimeout property is
represented in seconds, and the default value is
<span class="LITERAL">30</span>. By setting this property to zero, you are
allowing ADO to wait indefinitely for a specified command to execute.
If a command does time out, an error will be generated.</p>


<p>The CommandTimeout property of the Command object is unrelated to the
CommandTimeout property of the Connection object.</p>


<p>The Connection object's CommandTimeout is read- and
write-enabled even when the Connection object is open.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Note</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Not all providers support the CommandTimeout property.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.CommitTrans">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.CommitTrans Method </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)
</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr><td colspan="2" class="description">
<p>See the Connection.BeginTrans Method.</p></td>
</tr>
</table>
</div>
<div id="Connection.CommitTransComplete">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.CommitTransComplete Event </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Private Sub CommitTransComplete(ByVal <span class="replaceable">pError</span> As ADODB.Error, _<br>                                <span class="replaceable">adStatus</span> As ADODB.EventStatusEnum, _<br>                                ByVal <span class="replaceable">pConnection</span> As ADODB.Connection)</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The CommitTransComplete event is raised after the CommitTrans method
completes its operation.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">pError</span></dt>
<dd><p>An Error object containing details about an error that occurred if
the <span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">adStatus</span></dt>
<dd><p>An EventStatusEnum value indicating the status of the current
operation. If the <span class="replaceable">adStatus</span> parameter is
set to <span class="LITERAL">adStatusOK</span>, the operation was successful.
If the <span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>, the operation failed, and
the <span class="replaceable">pError</span> object contains the details
regarding the error. By setting the
<span class="replaceable">adStatus</span> parameter to
<span class="LITERAL">adStatusUnwantedEvent</span>, this event will not be
called again.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pConnection</span></dt>
<dd><p>The Connection object that fired this event.</p></dd>

</dl>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.BeginTransComplete Event, Connection.CommitTrans Method,
Connection.RollbackTransComplete Event, EventStatusEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.ConnectComplete">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.ConnectComplete Event </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Private Sub ConnectComplete(ByVal <span class="replaceable">pError</span> As ADODB.Error, _<br>                            <span class="replaceable">adStatus</span> As ADODB.EventStatusEnum, _<br>                            ByVal <span class="replaceable">pConnection</span> As ADODB.Connection)</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The ConnectComplete event is raised once a connection has been made.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">pError</span></dt>
<dd><p>An Error object containing details about an error that occurred if
the <span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">adStatus</span></dt>
<dd><p>An EventStatusEnum value indicating the status of the current
operation. If the <span class="replaceable">adStatus</span> parameter is
set to <span class="LITERAL">adStatusOK</span>, the operation was successful.
If the <span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>, the operation failed, and
the <span class="replaceable">pError</span> object contains the details
regarding the error. If the <span class="replaceable">adStatus</span>
parameter is set to <span class="LITERAL">adStatusUnwantedEvent</span>, this
event will not be called again.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pConnection</span></dt>
<dd><p>The Connection object that fired this event.</p></dd>

</dl>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.Disconnect Event, Connection.WillConnect Event,
ConnectOptionEnum Enumeration, EventStatusEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.ConnectionString">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.ConnectionString Property </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.ConnectionString = <span class="replaceable">connectionstring</span></td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The ConnectionString property defines the connection used to access a
data source.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>String</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The ConnectionString property indicates the data source to be used by
your connection. You may pass either a DSN (data source name) or a
detailed connection string, which is a list of arguments. The
arguments must be in the form of
<span class="replaceable">argument=value</span>, with multiple arguments
separated by a semicolon. If ADO finds an equal sign in the
ConnectionString property, it assumes that you are passing a detailed
connection string.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The three supported arguments are listed next. If you pass additional
arguments, they are passed directly to the data provider and are not
checked by ADO:</p>


<dl>
<dt><span class="replaceable">Provider</span></dt>
<dd><p>Specifies the name of the data provider to use for the particular
connection.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">Filename</span></dt>
<dd><p>Specifies the name of a data provider-specific file containing
connection information. This argument cannot be used with the
<span class="replaceable">Provider</span> argument.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">URL</span></dt>
<dd><p>Identifies the absolute URL of a file or directory.</p></dd>

</dl>


<p>The contents of the ConnectionString property can be altered by ADO
at any time after opening the Connection object, so read the property
if you are unsure of its contents.</p>


<p>If the ConnectionString argument was used in the Open method of the
Connection object, the value is placed within the ConnectionString
property of the Connection object.</p>


<p>While the Connection object is open, the ConnectionString is
read-only, but when it is closed, it is both read- and write-enabled.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.Open Method</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.ConnectionTimeout">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.ConnectionTimeout Property </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.ConnectionTimeout = <span class="replaceable">timeout</span></td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The ConnectionTimeout property indicates how long in seconds ADO will
wait while attempting a connection to a data source.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Long</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>By using the ConnectionTimeout property, you can specify how long ADO
will wait for a connection to a data source. The setting for the
ConnectionTimeout property is represented in seconds. By setting this
property to zero, you are allowing ADO to wait indefinitely for a
specified connection. If the connection does time out, an error is
generated.</p>


<p>The ConnectionTimeout property is read- and write-enabled while the
Connection object is closed, but read-only once it is opened.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Note</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Not all providers support the ConnectionTimeout property.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.Open Method</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.CursorLocation">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.CursorLocation Property </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.CursorLocation = <span class="replaceable">CursorLocationEnum</span></td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The CursorLocation property indicates the location of the cursor
service.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>CursorLocationEnum (Long)</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The value of the CursorLocation property can be set to one of the
valid CursorLocationEnum values, listed in <link linkend="ado-APP-E">Appendix E</link>.</p>


<p>The value of the CursorLocation property is both read- and
write-enabled. However, changing the value of this property affects
only Connections that are opened after the value has changed.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.Open Method</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.DefaultDatabase">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.DefaultDatabase Property </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.DefaultDatabase = <span class="replaceable">database</span></td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The DefaultDatabase property indicates the database that is chosen as
the default for the current connection.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>String</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The DefaultDatabase property allows the application to specify which
database is the default for a Connection object.</p>


<p>Unqualified syntax automatically refers to the database specified by
the DefaultDatabase property. Qualifying the object names with the
desired database name must be done to access all other databases.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Note</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Not all providers support the DefaultDatabase property. If they do
not, they may raise an error or return an empty String value.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.Disconnect">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.Disconnect Event </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Private Sub Disconnect(<span class="replaceable">adStatus</span> As ADODB.EventStatusEnum, _<br>                       ByVal <span class="replaceable">pConnection</span> As ADODB.Connection)</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The Disconnect event is raised once a connection has ended.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">adStatus</span></dt>
<dd><p>An EventStatusEnum value indicating the status of the current
operation. The <span class="replaceable">adStatus</span> parameter is
always set to <span class="LITERAL">adStatusOK</span> when the event is fired.
Setting the <span class="replaceable">adStatus</span> parameter to
<span class="LITERAL">adStatusUnwantedEvent</span> before leaving the event
code means that this event will not be called again.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pConnection</span></dt>
<dd><p>The Connection object that fired this event.</p></dd>

</dl>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.ConnectComplete Event, EventStatusEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.Errors">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.Errors Collection </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Set <span class="replaceable">errors</span> = <span class="replaceable">connection</span>.Errors</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The Errors collection is a collection of individual errors and
warnings that have occurred for the last operation on the current
Connection object.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Errors (Collection Object)</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The Errors property of the Connection object is read-only. It returns
a reference to the Errors collection object that can contain zero or
many Error objects that indicate ADO or provider-specific errors.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.Execute">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.Execute Method </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>connection.Execute <span class="replaceable">CommandText, RecordsAffected, Options</span><br>Set recordset = connection.Execute(<span class="replaceable">CommandText, RecordsAffected, Options</span>)</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The Execute method is used to execute a specified SQL statement,
query, stored procedure, URL, or provider-specific command against
the data source.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">CommandText</span> (String)</dt>
<dd><p>Optional. Contains the SQL statement, query, stored procedure, URL,
or provider-specific command to be executed. The parameter is similar
to the Command.CommandText property.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">RecordsAffected</span> (Long)</dt>
<dd><p>Optional. Contains the number of records that the executed command
affected.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">Options</span> (Long)</dt>
<dd><p>Optional. Represents a combination of one or more CommandTypeEnum and
ExecuteOptionEnum values indicating how the data provider should
treat the command. The default value is -1 (no options set).</p></dd>

</dl>


<p>The CommandTypeEnum and ExecuteOptionEnum enumeration values are
listed in <link linkend="ado-APP-E">Appendix E</link>.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Returns</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>RecordsetObject</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The Execute method executes the command specified by the CommandText
parameter, which in turn is evaluated based upon the Options
parameter. When the execution of the command is complete, the
Connection.ExecuteComplete event is raised.</p>


<p>If the execution of the command returns records, a new Recordset
object is returned from the Execute method. If the execution of the
command does not return records, an empty Recordset object is
returned from the Execute method. Regardless, the Recordset returned
is always read-only with a forward-only cursor.</p>


<p>When the Execute method's Options parameter includes one of the
<span class="LITERAL">adAsyncExecute</span>, <span class="LITERAL">adAsyncFetch</span>,
or <span class="LITERAL">adAsyncFetchNonBlocking</span> values, operations
continue in the background of the application flow. While these
operations are continuing, the Connection.Cancel method can be called
to cancel all pending asynchronous operations.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Note</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Although the documentation for ADO 2.6 (beta 2) has specified that
the CommandText arguments and property can be set to a relative URL,
I have found that whatever you set this value to, it is irrelevant.
If you wish to obtain the contents of a directory, you must specify
the directory in the ConnectionString property. No matter what you
specify as the CommandText arguments of the Execute method or the
CommandText property of the Connection object, it is ignored.
However, if you use an empty String (") as a value, you
will receive the error "Errors Occurred."</p>


<p>The following example illustrates how the CommandText property value
is irrelevant when calling the Execute method:</p>


<span class="PROGRAMLISTING"><pre>Dim con As ADODB.Connection
Dim rec As ADODB.Recordset

Set con = New ADODB.Connection

con.Open "URL=http://jroff_laptop/"

Set rec = con.Execute("nothing really matters")
    
'
' rec contains contents of jroff_laptop
'

rec.Close
con.Close

Set rec = Nothing
Set con = Nothing</pre></span>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.Cancel Method, Command.CommandText Property,
Connection.ExecuteComplete Event, CommandTypeEnum Enumeration,
ExecuteOptionEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.ExecuteComplete">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.ExecuteComplete Event </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Private Sub con_ExecuteComplete(ByVal <span class="replaceable">RecordsAffected</span> As Long, _<br>                                ByVal <span class="replaceable">pError</span> As ADODB.Error, _<br>                                <span class="replaceable">adStatus</span> As ADODB.EventStatusEnum, _<br>                                ByVal <span class="replaceable">pCommand</span> As ADODB.Command, _<br>                                ByVal <span class="replaceable">pRecordset</span> As ADODB.Recordset, _<br>                                ByVal <span class="replaceable">pConnection</span> As ADODB.Connection)</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The ExecuteComplete event is called when the execution of a command
has completed.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">RecordsAffected</span> (Long)</dt>
<dd><p>Indicates how many records are affected by the executed command.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pError</span> (Error)</dt>
<dd><p>Contains details about an error that occurred if the
<span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">adStatus</span> (EventStatusEnum)</dt>
<dd><p>Indicates the status of the current operation. If the
<span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusOK</span>, the operation was successful. If the
<span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>, the operation failed, and
the <span class="replaceable">pError</span> object contains the details
regarding the error. If the <span class="replaceable">adStatus</span>
parameter is set to <span class="LITERAL">adStatusUnwantedEvent</span>, this
event will not be called again.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pCommand</span></dt>
<dd><p>Represents the Command object that was executed (if there was one).</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pRecordset</span></dt>
<dd><p>Represents the Recordset object that results from the commands
execution. This Recordset object can be empty.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pConnection</span></dt>
<dd><p>Represents the Connection object that fired this event.</p></dd>

</dl>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.Execute Method, Command.Execute Method,
Recordset.NextRecordset Method, Recordset.Open Method,
EventStatusEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.InfoMessage">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.InfoMessage Event </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Private Sub InfoMessage(ByVal <span class="replaceable">pError</span> As ADODB.Error, _<br>                        <span class="replaceable">adStatus</span> As ADODB.EventStatusEnum, _<br>                        ByVal <span class="replaceable">pConnection</span> As ADODB.Connection)</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The InfoMessage event is called when a warning is produced during a
ConnectionEvent operation.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">pError</span></dt>
<dd><p>An Error object containing details about an error that occurred if
the <span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">adStatus</span></dt>
<dd><p>An EventStatusEnum value indicating the status of the current
operation. If the <span class="replaceable">adStatus</span> parameter is
set to <span class="LITERAL">adStatusOK</span>, the operation was successful.
If the <span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>, the operation failed, and
the <span class="replaceable">pError</span> object contains the details
regarding the error. If the <span class="replaceable">adStatus</span>
parameter is set to <span class="LITERAL">adStatusUnwantedEvent</span>, this
event will not be called again.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pRecordset</span></dt>
<dd><p>The Recordset object that fired this event.</p></dd>

</dl>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>EventStatusEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.IsolationLevel">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.IsolationLevel Property </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.IsolationLevel = <span class="replaceable">IsolationLevelEnum</span></td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The IsolationLevel property is used to set the level of isolation
used when utilizing transaction management.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>IsolationLevelEnum (Long)</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The IsolationLevel property is both read- and write-enabled. If the
value of this property is changed, the effects will not take place
until you call the BeginTrans method. If the level of isolation
requested couldn't be granted by the data provider, then the
next level may be set automatically.</p>


<p>The IsolationLevel property can be set to one of the
IsolationLevelEnum enumerations listed in <link linkend="ado-APP-E">Appendix E</link>.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.BeginTrans Method, IsolationLevelEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.Mode">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.Mode Property </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.Mode = <span class="replaceable">ConnectModeEnum</span></td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The Mode property identifies the available permissions for modifying
data within the specified connection.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>ConnectModeEnum (Long)</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The Mode property is read- and write-enabled while the Connection
object is closed, but read-only once it is opened.</p>


<p>The Mode property can be set to one of the ConnectModeEnum
enumerations listed in <link linkend="ado-APP-E">Appendix E</link>.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.Open">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.Open Method </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.Open <span class="replaceable">ConnectionString, UserID, Password, Options</span></td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The Open method for the Connection object opens a connection to a
particular data source. The Open method for the Recordset object
opens a cursor.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">ConnectionString</span> (String)</dt>
<dd><p>Optional. Contains the information needed for ADO to connect to the
data provider. This property is mapped to the
Connection.ConnectionString property.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">UserID</span> (String)</dt>
<dd><p>Optional. Contains a username that is used to establish the desired
connection.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">Password</span> (String)</dt>
<dd><p>Optional. Contains a password that is used to establish the desired
connection.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">Options</span> (Long)</dt>
<dd><p>Optional. Represents a ConnectOptionEnum enumeration value.
Currently, the only defined value for the ConnectOptionEnum
enumeration is <span class="LITERAL">adAsyncConnect</span> (16) which instructs
ADO to connect to the data source asynchronously. The default value
is -1 (no options set).</p></dd>

</dl>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The Open method establishes a connection with a data provider. Once a
connection is established, you can issue commands against the data
provider and obtain information from the data source.</p>


<p>The connection to a data provider can be established asynchronously
by passing the <span class="LITERAL">adConnectAsync</span> value to the Options
parameter of the Open method. Once the operation has started, the
application can call the Connection.Cancel method to cancel the
pending asynchronous connection if the application has determined
that the connection is taking too long.</p>


<p>The connection to the data provider is defined by the value of the
ConnectionString parameter. In addition, the
<span class="replaceable">UserName</span> and
<span class="replaceable">Password</span> parameters authenticates the user
within the data provider. It is possible to set the
<span class="replaceable">UserName</span> and
<span class="replaceable">Password</span> values in both the
ConnectionString and as parameters to the Open method. In such a
case, the parameters will override those specified in the
ConnectionString property.</p>


<p>The ConnectionString parameter overwrites any value previously set to
the Connection.ConnectionString property. In most cases, the
ConnectionString property contains more detailed information about
the connection then you would pass through the ConnectionString
parameter of the Open method. You can read the ConnectionString
property to see this added detail.</p>


<p>The ConnectionString parameter, like the ConnectionString property,
is constructed of a services of
<span class="replaceable">argument=value</span> statements separated by
semicolons. The arguments that are used within the ConnectionString
parameter (and property) are completely dependent upon the data
provider to which you are connecting.</p>


<p>The Connection.Close method is used to close an opened Connection
object once the application is done with it. A Connection object that
is closed can be altered and reopened again. To remove the Connection
object from memory in Visual Basic, set it to
<span class="LITERAL">Nothing</span>.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.Cancel Method, Connection.Close Method,
Connection.ConnectionString Property, ConnectModeEnum Enumeration,
ConnectOptionEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.OpenSchema">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.OpenSchema </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Set recordset = <span class="replaceable">connection</span>.OpenSchema(<span class="replaceable">Schema, Criteria, SchemaID</span>)</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The OpenSchema method returns a Recordset object containing
information about the data source's schema.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">Schema</span> (SchemaEnum)</dt>
<dd><p>Indicates the type of schema the OpenSchema method will provide in
the returned Recordset object.</p></dd>

</dl>


<p>SchemaEnum contains the enumeration values listed in Table F-1.</p>


<dl>
<dt><span class="replaceable">Criteria</span> (Variant Array)</dt>
<dd><p>Optional. Indicates which constraint columns to use for the Schema
requested. A list of each available constraint column for each schema
type is listed in Table G-1.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">SchemaID</span> (Long)</dt>
<dd><p>Optional. Represents a GUID of a provider-specific schema query. If
the Schema parameter is set to
<span class="LITERAL">adSchemaProviderSpecific</span> (-1), then this parameter
is mandatory; otherwise, it is not used.</p></dd>

</dl>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The OpenSchema method is used to obtain information about a data
source's structure -- its schema.</p>


<p>By setting the <span class="replaceable">Schema</span> parameter to a
SchemaEnum value, ADO can determine which information the application
is requesting. In addition, the <span class="replaceable">Criteria</span>
parameter can be set to narrow the search. For instance, by passing
the <span class="LITERAL">adSchemaTables</span> enumeration value, the
OpenSchema method will only return the table names.</p>


<p>Some providers may support their own schema query types. To use this
feature, set the <span class="replaceable">Schema</span> parameter to
<span class="LITERAL">adSchemaProviderSpecific</span>, and set the
<span class="replaceable">SchemaID</span> parameter to the GUID of the
provider-specific schema query. If the
<span class="replaceable">Schema</span> parameter is set to the
<span class="LITERAL">adSchemaProviderSpecific</span> value and the
<span class="replaceable">SchemaID</span> parameter is not specified, an
error will occur.</p>


<p>Not all providers will support all of the schema queries defined in
Table G-1. As a matter of fact, only the adSchemaTables,
adSchemaColumns, and adSchemaProviderTypes schema queries are
supported by all providers. But this still does not guarantee that
any of the constraint columns are supported.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>SchemaEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.Properties">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.Properties Collection </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Set <span class="replaceable">properties</span> = <span class="replaceable">connection</span>.Properties</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The Properties collection contains characteristics specific to the
Connection object for the currently used provider.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Properties (Collection Object)</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The Properties collection class contains a Property class instance
for each property specific to the Connection object for the data
provider.</p>


<p>The Properties collection of the Connection object contains only the
following properties until the Connection is opened:</p>


<ul><li><p>Password</p></li></ul>
<ul><li><p>Persist Security Info</p></li></ul>
<ul><li><p>User ID</p></li></ul>
<ul><li><p>Data Source</p></li></ul>
<ul><li><p>Window Handle</p></li></ul>
<ul><li><p>Location</p></li></ul>
<ul><li><p>Mode</p></li></ul>
<ul><li><p>Prompt</p></li></ul>
<ul><li><p>Connect Timeout</p></li></ul>
<ul><li><p>Extended Properties</p></li></ul>
<ul><li><p>Locale Identifier</p></li></ul>
<ul><li><p>Initial Catalog</p></li></ul>
<ul><li><p>OLE DB Services</p></li></ul>
<ul><li><p>General Timeout</p></li></ul>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.Provider">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.Provider Property </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">connection</span>.Provider = <span class="replaceable">provider</span></td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The Provider property indicates the name of the data provider for the
current Connection object.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>String</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The Provider property sets the provider for the current Connection
object. It can also be specified in the ConnectionString property of
the Connection object or the ConnectionString argument to the Open
method of the Connection object. It is recommended that the provider
be specified in only one of these places, however, because the
results can be unpredictable.</p>


<p>The Provider property of the Connection object is read- and
write-enabled when the associated Connection object is closed, but
read-only once it is open.</p>


<p>The Provider property is not used until the Connection object is
opened or the Properties collection of the Connection object is used.</p>


<p>If no provider is specified, ADO will default to
<span class="LITERAL">MSDASQL</span>, the Microsoft ODBC Provider for OLE DB.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.ConnectionString Property, Connection.Open Method</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.RollbackTrans">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.RollbackTrans Method </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr><td colspan="2" class="description">
<p>See the Connection.BeginTrans Method.</p></td>
</tr>
</table>
</div>
<div id="Connection.RollbackTransComplete">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.RollbackTransComplete Event </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Private Sub con_RollbackTransComplete(ByVal <span class="replaceable">pError</span> As ADODB.Error, _<br>                                      <span class="replaceable">adStatus</span> As ADODB.EventStatusEnum, _<br>                                      ByVal <span class="replaceable">pConnection</span> As ADODB.Connection)</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The RollbackTransComplete event is raised after the RollbackTrans
method has completed its operation.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">pError</span></dt>
<dd><p>An Error object containing details about an error that occurred if
the <span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">adStatus</span></dt>
<dd><p>An EventStatusEnum value indicating the status of the current
operation. If the <span class="replaceable">adStatus</span> parameter is
set to <span class="LITERAL">adStatusOK</span>, the operation was successful.
If the <span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusErrorsOccurred</span>, the operation failed, and
the <span class="replaceable">pError</span> object contains the details
regarding the error. If the <span class="replaceable">adStatus</span>
parameter is set to <span class="LITERAL">adStatusUnwantedEvent</span>, this
event will not be called again.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pConnection</span></dt>
<dd><p>The Connection object that fired this event.</p></dd>

</dl>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.BeginTransComplete Event, Connection.CommitTransComplete
Event, Connection.RollbackTrans Method, EventStatusEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.State">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.State Property </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br><span class="replaceable">state = connection</span>.State</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The State property indicates the current status of a Command,
Connection, Record, Recordset, or Stream object.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>ObjectStateEnum (Long)</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The State property returns a combination of the ObjectStateEnum
values, listed in <link linkend="ado-APP-E">Appendix E</link>, which indicate the
current state of an object.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>ObjectStateEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.Version">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.Version Property </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>version = <span class="replaceable">connection</span>.Version</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The Version property indicates the current version of ADO in use.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Datatype</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>String</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Description</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The Version property returns the version information for the version
of ADO that you are using in your application, in the form of a
String.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.WillConnect">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.WillConnect Event </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Private Sub WillConnect(<span class="replaceable">ConnectionString</span> As String, _<br>                        <span class="replaceable">UserID</span> As String, _<br>                        <span class="replaceable">Password</span> As String, _<br>                        <span class="replaceable">Options</span> As Long, _<br>                        <span class="replaceable">adStatus</span> As ADODB.EventStatusEnum, _<br>                        ByVal <span class="replaceable">pConnection</span> As ADODB.Connection)</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The WillConnect event is raised before a connection is made.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">ConnectionString</span> (String)</dt>
<dd><p>Contains the connection information for the awaiting connection
operation.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">UserID</span> (String)</dt>
<dd><p>Contains the username for the awaiting connection operation.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">Password</span> (String)</dt>
<dd><p>Contains the password for the awaiting connection operation.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">Options</span> (Long)</dt>
<dd><p>Indicates how the ConnectionString parameter should be evaluated. For
this parameter, the only valid value is
<span class="LITERAL">adAsyncOpen</span>.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">adStatus</span> (EventStatusEnum)</dt>
<dd><p>Indicates the status of the current operation. The
<span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusOK</span> if the operation causing this event was
successful. If the <span class="replaceable">adStatus</span> parameter is
set to <span class="LITERAL">adStatusCantDeny</span>, the event cannot request
that the operation be canceled. If the
<span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusUnwantedEvent</span>, this event will not be
called again. If the <span class="replaceable">adStatus</span> parameter is
set to <span class="LITERAL">adStatusCancel</span>, a cancelation request will
be made for this operation.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pConnection</span></dt>
<dd><p>Represents the Connection object that fired this event.</p></dd>

</dl>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Note</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>The <span class="replaceable">ConnectionString</span>,
<span class="replaceable">UserID</span>, and
<span class="replaceable">Password</span> parameters can be changed by the
application within this event before the operation finishes
execution.</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.ConnectComplete Event, EventStatusEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="Connection.WillExecute">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Connection.WillExecute Event </td>
<td class="COMPATIBILITY">(Versions 2.0, 2.1, 2.5, 2.6)</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2"><br>Private Sub WillExecute(<span class="replaceable">Source</span> As String, _<br>                        <span class="replaceable">CursorType</span> As ADODB.CursorTypeEnum, _<br>                        <span class="replaceable">LockType</span> As ADODB.LockTypeEnum, _<br>                        <span class="replaceable">Options</span> As Long, _<br>                        <span class="replaceable">adStatus</span> As ADODB.EventStatusEnum, _<br>                        ByVal <span class="replaceable">pCommand</span> As ADODB.Command, _<br>                        ByVal <span class="replaceable">pRecordset</span> As ADODB.Recordset, _<br>                        ByVal <span class="replaceable">pConnection</span> As ADODB.Connection)</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr><td colspan="2" class="description">


<p>The WillExecute event is raised before an execution of a command has
begun.</p>

</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Arguments</td>
</tr>
<tr>
<td colspan="2" class="description">


<dl>
<dt><span class="replaceable">Source</span> (String)</dt>
<dd><p>Contains the source of the command that is to be executed. This value
is usually a SQL statement or a stored procedure name.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">CursorType</span> (CursorTypeEnum)</dt>
<dd><p>Indicates the type of Recordset object that will be opened. This
value can be changed within the event to change the type of cursor
that gets used when the Recordset.Open method is called. This
parameter is ignored for any other method that causes this event.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">LockType</span> (LockTypeEnum)</dt>
<dd><p>Indicates the locking scheme that will be used when the Recordset
object is opened. This value can be changed within the event to
change the locking scheme that gets used when the Recordset.Open
method is called. This parameter is ignored for any other method that
causes this event.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">Options</span> (Long)</dt>
<dd><p>Indicates any other options used to execute the command or open the
recordset.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">adStatus</span> (EventStatusEnum)</dt>
<dd><p>Indicates the status of the current operation. The
<span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusOK</span> if the operation causing this event was
successful. If the <span class="replaceable">adStatus</span> parameter is
set to <span class="LITERAL">adStatusCantDeny</span>, the event cannot request
that the operation be canceled. If the
<span class="replaceable">adStatus</span> parameter is set to
<span class="LITERAL">adStatusUnwantedEvent</span>, this event will not be
called again. By setting the <span class="replaceable">adStatus</span>
parameter to <span class="LITERAL">adStatusCancel</span>, a cancelation request
will be made for this operation.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pCommand</span></dt>
<dd><p>Represents the Command object to which this event applies. Set to
<span class="LITERAL">Nothing</span> if this event was raised because of a
Connection.Execute method or a Recordset.Open method.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pRecordset</span></dt>
<dd><p>Represents the Recordset object to which this event applies. Set to
<span class="LITERAL">Nothing</span> if this event was raised because of a
Connection.Execute method or a Command.Execute method.</p></dd>

</dl>


<dl>
<dt><span class="replaceable">pConnection</span></dt>
<dd><p>Represents the Connection object that fired this event.</p></dd>

</dl>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">See Also</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Connection.Execute Method, Command.Execute Method, Recordset.Open
Method, EventStatusEnum Enumeration, LockTypeEnum Enumeration</p>


</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
</body>
</html>