In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to query ADO construction". In daily operation, I believe many people have doubts about how to query ADO construction. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "how to query ADO construction"! Next, please follow the editor to study!
When constructing a query, it is a complex issue to figure out why this must be done and why it cannot be done. However, there are some basic guidelines that can make the process of building efficient queries smoother and easier. In general, you should not let queries waste server time. Here are a few tips that can help you build better and more efficient queries.
Do not force the ADO construct to recompile and reconstruct the query execution plan each time the query is executed. An easy way to avoid this repetitive operation is to use stored procedures with parameters. Be careful not to use the Prepare property of the ADO Command object as much as possible-sometimes it doesn't work correctly. If you use stored procedures, you can also further improve ADO performance by eliminating unnecessary "affected rows" return values-just add SET NOCOUNT ON to the stored procedure.
Minimize the number of communications with the server. If you have several related operations to perform, merge them into a stored procedure, or a composite query that can be executed as a script on the server. ADO construction avoids the use of methods (such as Refresh) and inappropriate Parameters collection references, and ADO construction forces ADO to add additional server communication processes.
In client / server applications, the Command object is constructed only once, not every time the Command object is used. You can reset the parameter value of Command and then execute it as needed.
When the query returns not a recordset, be sure to use the adExecuteNoRecords option and tell ADO to bypass all the code used to receive and construct the recordset (in Recordset format). ADO construction you can pass the adExecuteNoRecords option to the Execute method, or use it as an option for Command.
Do not use the Command object when executing a stored procedure that returns a simple recordset. All stored procedures (and Command objects) can appear as COM methods of Connection objects. Having stored procedures appear as methods of Connection objects has a significant performance advantage, and it also simplifies the code.
Although this technique is not helpful for stored procedures that have Return Status values or Output parameters, it is useful for ADO construction of action queries (INSERT, DELETE, etc.) and for queries that return one or more records. After using the stored procedure as a method of Connection, you can pass in the input parameters of the stored procedure in the form of method parameters; if the calling stored procedure returns a recordset, you can reference the Recordset through a parameter in the method call. For example, the following ADO construct executes a stored procedure named "Fred". The Fred stored procedure takes two input parameters and returns a Recordset
At this point, the study on "how to query ADO constructs" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.