What is the best way to extract the recordset?
So far we have been extracting recordsets by creating Recordset objects, but ADO also provides an indirect method of Recordset extraction. The following tests compare ado__03.asp and create recordsets (conn_01.asp) directly from the Connection object:
Set objconn = Server.CreateObject ("ADODB. Connection ")
objConn.Open application ("Conn")
Set objRS = objConn.Execute (Application ("SQL"))
You can see a slight increase in page overhead and no change in the display time of individual records.
Now let's take a look at creating a Recordset object directly from the command object (cmd__02.asp):
Set objcmd = Server.CreateObject ("Adodb.command")
objcmd.activeconnection = Application ("Conn")
objCmd.CommandText = Application ("SQL")
Set objRS = Objcmd.execute
Similarly, page overhead also increases slightly, while the display time of individual records does not change in nature. The difference in performance between these two methods is small, but we still have one important issue to consider.
When you create recordsets from the Recordset class, we are able to control how recordsets are handled with the greatest flexibility. Since the following two methods do not have overwhelming performance, we mainly consider the default return cursor types and record locking, for some occasions, the default value is not necessarily the most ideal.
Therefore, unless you need to select the following two methods for special reasons, we recommend that you consider this rule:
Instantiate recordsets with Adodb.recordset classes for the best performance and flexibility.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service