In Oracle, using ADO objects to access and access ADO is short for Active Data objects. It is called ActiveX Data Objects. Using an ADO object, you can use an ODBC driver or an ole db connection string to access and access any database. Ole db is a database access technology that Microsoft uses to replace ODBC. It is a database access technology that is effective for both relational databases and non-relational databases. ADO provides seven independent objects, which can be used to access and access the database: www.2cto.com · Connection object. · Command object: You can use the Command object to execute an SQL stored procedure or query with parameters. · Parameter object. · Recordset record set object, which represents a group of records obtained from a data table through query. The methods and attributes of this object allow you to access and operate records. · Field object, representing a Field in the record set. Fields is a set of Fields, and tb represents all Fields of a record. · Property object. Www.2cto.com · Error object. Connection, Command, and Recordset are the core of the entire ADO. The Connection object is used to establish a Connection with a database, and then the Command object is used to execute a query to return the query result, and the result (record set) is returned) stored in the Recordset object. By accessing the Recordset object using server scripts, you can obtain the queried record content. In addition, you can use the Execute method of the Connection object and the Open method of the Recordset object to Execute a query and return a record set. User Data Sources of ODBC data sources, system data sources, and file data sources. The user and system DSN are stored in the WindowsNT registry. The system DSN can be accessed and used by all logged-on users. The user DSN can only be accessed and used by specific users. File DSN is stored in a text file with the extension. dsn, which can be accessed and used by multiple users and can be copied. This method is generally used. Before using the ADO connection object www.2cto.com, you must first create an instance of this object: Set Instance name = Server. createObject ("ADODB. connection ") Connection object method: · Open method Connection object. open Data Source Name | when the connection string calls the Open method with parameters, the parameters are actually passed to the ConnectionString attribute of the connection object. Therefore, you can set the value of the ConnectionString Attribute before calling the Open method without parameters. · Close method connection object. Close release: Set conn = Nothing · Execute method this method is used to Execute SQL statements. This method is used in the following two formats: 1. When an SQL query statement is executed, the record set obtained from the query is returned. Usage: www.2cto.com Set object variable name = connection object. after the Execute ("SQL query language") Execute method is called, the record Set object is automatically created and the query results are stored in the record object, save the record set to the specified object. The object variable will represent the record set object in the future. 2. When the SQL operator language is executed, no record set is returned. The usage is: connection object. execute "SQL operational statement" [, RecordAffected] [, Option] · RecordAffected is optional. A variable can be placed here. After the SQL statement is executed, the number of valid records is automatically saved to the variable. By accessing this variable, you can know how many records the SQL statement team has performed. · Option. The value of this parameter is generally adshorttext, which is used to tell ADO that the first character after the Execute method should be interpreted as the command text. You can specify this parameter to make execution more efficient. · The BeginTrans, RollbackTrans, and CommitTrans methods are the methods provided by the connection object for transaction processing. BeginTrans is used to start a transaction; RollbackTrans is used to roll back the transaction; CommitTrans is used to submit all the transaction processing results, that is, to confirm the processing of the transaction. Www.2cto.com transaction processing can regard a group of operations as a whole. Only when all statements are successfully executed can the transaction be processed successfully. If one of the statements fails to be executed, the entire transaction will fail, and restore the status before everywhere. BeginTrans and CommitTrans are used to mark the start and end of a transaction. The statements between them are used as the statement for transaction processing. To determine whether the transaction is successfully processed, you can use the Error set of the connected object. If the number of members in the Error set is not 0, an Error occurs and the transaction fails to be processed. Each Error object in the Error set represents an Error message. In addition, you can use the transaction processing statements provided by SQL to write a stored procedure, and then use the methods related to the ADO command object to call and execute the stored procedure.