Connection object ¶
ADO
Connection
object is used to create an open connection to a data source. Through this connection, you can access and manipulate a database.
If you need to access a database multiple times, you should use the
Connection
object to establish a connection. You can also go through a
Command
or
Recordset
object passes a connection string to create a connection. However, such joins are only suitable for a specific and simple query.ProgID ¶
set objConnection=Server.CreateObject("ADODB.connection")
Attribute ¶
Attribute | Description |
|---|---|
| Set or return |
| Indicates the amount of time to wait during command execution before terminating the attempt and generating an error. |
| Sets or returns details used to establish a connection to the data source. |
| Indicates the time to wait during connection establishment before terminating the attempt and generating an error. |
| Sets or returns the location of the cursor service. |
| Indication |
| Indication |
| Set or return |
| Set or return |
| Returns a value that describes whether the connection is open or closed. |
| Returns the version number of the ADO. |
Method ¶
Method | Description |
|---|---|
| Start a new transaction. |
| Cancel an execution. |
| Close a connection. |
| Save any changes and end the current transaction. |
| Execute a query, SQL statement, stored procedure, or |
| Open a connection. |
| From |
| Cancels any changes made in the current transaction and ends the transaction. |
Event ¶
Note: you cannot use VBScript or JScript to handle events (you can only handle events using the Visual Basic, Visual C++, and Visual jacks + languages).
Event | Description |
|---|---|
| In |
| In |
| Triggered after the start of a connection. |
| Triggered after the end of a connection. |
| Triggered after the execution of a command. |
| If you are in a |
| In |
| Triggered before a connection starts. |
| Triggered before a command is executed. |
Set ¶
Set | Description |
|---|---|
Errors | All Error objects that contain Connection objects. |
Properties | All Property objects that contain Connection objects. |