ADO is a com provided by Microsoft for accessing databases. There are three basic interfaces: _ connectionptr, _ commandptr, and _ recordsetptr.
_ Connectionptr interface returns a record set or a null pointer. It is usually used to create a data connection or execute an SQL statement that does not return any results, such as a stored procedure. Returning a record set using the _ connectionptr interface is not a good method. Generally, like cdatabase, it is used to create a data connection, and other objects are used to perform data input and output operations.
The _ commandptr interface returns a record set. It provides a simple method to execute stored procedures and SQL statements that return record sets. When using the _ commandptr interface, you can use the global _ connectionptr interface, or you can directly use the connection string in the _ commandptr interface. If only one or several data access operations are performed, the latter is a good choice. However, if you want to frequently access the database and return many record sets, you should use the global _ connectionptr interface to create a data connection and then use the _ commandptr interface to execute stored procedures and SQL statements.
_ Recordsetptr is a record set object. Compared with the above two types of objects, it provides more control functions for the record set, such as record lock and cursor control. Like the _ commandptr interface, it does not have to use a created data connection. You can use a connection string to replace the connection pointer with the connection Member variable assigned to _ recordsetptr, create a data connection. If you want to use multiple record sets, the best way is to use the global-connectionptr interface that has created a data connection like the command object, and then use _ recordsetptr to execute the stored procedure and SQL statements.
Introduction to ADO Interfaces