ADO Connection Object
Connection-objekt
ADO Connection-objektet bruges til at oprette en åben forbindelse til en datakilde. Gennem denne forbindelse kan du få adgang til og operere med en database.
If you need to access a database multiple times, you should use a Connection object to establish a connection. You can also create a connection by passing a connection string through a Command or Recordset object. However, such connections are only suitable for a specific simple query.
ProgID
set objConnection=Server.CreateObject("ADODB.connection")
Properties
Properties |
Beskrivelse |
Attributes |
Set or return the properties of the Connection object. |
CommandTimeout |
Indicate the time to wait before executing a command, before termination attempts and errors occur. |
ConnectionString |
Set or return the details information of the data source for establishing a connection. |
ConnectionTimeout |
Indicate the time to wait during the establishment of a connection before termination attempts and errors occur. |
CursorLocation |
Set or return the location of the cursor service. |
DefaultDatabase |
Indicate the default database of the Connection object. |
IsolationLevel |
Indicate the isolation level of the Connection object. |
Mode |
Set or return the access rights of the provider. |
Provider |
Set or return the name of the provider of the Connection object. |
State |
Return a value describing whether the connection is open or closed. |
Version |
Return the version number of ADO. |
Method
Method |
Beskrivelse |
BeginTrans |
Start a new transaction. |
Cancel |
Cancel an execution. |
Close |
Close a connection. |
CommitTrans |
Save any changes and end the current transaction. |
Execute |
Execute a query, SQL statement, stored procedure, or specific text of the provider. |
Open |
Open a connection. |
OpenSchema |
Return schema information about the data source from the provider. |
RollbackTrans |
Cancel any changes made in the current transaction and end the transaction. |
Event
Note: You cannot use VBScript or JScript to handle events (you can only use Visual Basic, Visual C++ and Visual J++ languages to handle events).
Samling
Samling |
Beskrivelse |
Errors |
Alle Error Objects, der indeholder Connection Object. |
Properties |
Alle Property Objects, der indeholder Connection Object. |