Databases Reference
In-Depth Information
Prevents other users from opening the connection with any permission.
Provider
Specifies the data provider. Note that the data provider can alternatively be
specified in the ConnectionString property.
State
Returns the state of the connection (read-only). The possible values are given by
the following enum:
Enum ObjectStateEnum
adStateClosed = 0
adStateOpen = 1
adStateConnecting = 2
adStateExecuting = 4
adStateFetching = 8
End Enum
Version
Returns the ADO version number as a string.
17.4.2.2 Methods of the Connection object
The main methods of the Connection object are:
Close
Closes the connection. Its syntax is simply:
cn.Close
Execute
Executes a command. A command can be a database query, an SQL statement, a
stored procedure, or a provider-specific command in text form. We emphasize
that the form of command depends on the data provider. For instance, not all data
providers support stored procedures or even SQL statements.
Note that some commands return a recordset and some do not. Accordingly, there
are two syntaxes for the Execute method:
' Syntax for a non recordset-returning command
ConnectionObject.Execute CommandText , RecordsAffected , Options
' Syntax for a recordset-returning command
Dim rs As ADODB.Recordset
Search WWH ::




Custom Search