Methods of the Connection Object

The Connection object also provides a number of methods to use when working with a connection object. Those methods are described in the following table.

Method

Description

BeginTrans

Begins a new transaction.

Cancel

Cancels the execution of a pending Open or Execute method.

Close

Closes the connection to the data source.

CommitTrans

Saves any changes and ends the current transaction.

Execute

Executes a command on the connection. This method can pass a query string to the execute method to use without a Command object or can use the Command object to persist the command text and re-execute it. A Command object is also required to use query parameters.

Method

Description

Open

Establishes the connection to the data source.

OpenSchema

Obtains database schema information from the provider.

RollbackTrans

Cancels any changes made in the current transaction and ends the transaction.

0 0

Post a comment