Objeto de conexão ADO
Objeto de conexão
O objeto de conexão ADO é usado para criar uma conexão aberta com uma fonte de dados. Através desta conexão, você pode acessar e manipular um banco de dados.
Se você deseja acessar um banco de dados várias vezes, deve estabelecer uma conexão usando o objeto Connection. Você também pode fazer uma conexão com um banco de dados passando uma string de conexão por meio de um objeto Command ou Recordset. No entanto, esse tipo de conexão só é bom para uma única consulta específica.
ProgID
set objConnection=Server.CreateObject("ADODB.connection")
Propriedades
Property |
Description |
Attributes |
Sets or returns the attributes of a Connection
object |
CommandTimeout |
Sets or returns the number of seconds to wait while
attempting to execute a command |
ConnectionString |
Sets or returns the details used to create a connection to a data
source |
ConnectionTimeout |
Sets or returns the number of seconds to wait for a connection to
open |
CursorLocation |
Sets or returns the location of the cursor service |
DefaultDatabase |
Sets or returns the default database name |
IsolationLevel |
Sets or returns the isolation level |
Mode |
Sets or returns the provider access permission |
Provider |
Sets or returns the provider name |
State |
Returns a value describing if the connection is open or
closed |
Version |
Returns the ADO version number |
Métodos
Method |
Description |
BeginTrans |
Begins a new transaction |
Cancel |
Cancels an execution |
Close |
Closes a connection |
CommitTrans |
Saves any changes and ends the current transaction |
Execute |
Executes a query, statement, procedure or provider specific
text |
Open |
Opens a connection |
OpenSchema |
Returns schema information from the provider about the data
source |
RollbackTrans |
Cancels any changes in the current transaction and ends the
transaction |
Eventos
Observação: você não pode manipular eventos usando VBScript ou JScript (somente as linguagens Visual Basic, Visual C++ e Visual J++ podem manipular eventos).
Coleções
Collection |
Description |
Errors |
Contains all the Error objects of the Connection object |
Properties |
Contains all the Property objects of the Connection object |