Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What problems should be paid attention to when connecting to ADO?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "ADO connection to pay attention to what problems," interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "What problems should you pay attention to when connecting ADO"!

Instead of using ConnectionString in ADO connections, we open the Connection object in a separate way; this makes it convenient to reference the Connection object when we want to close it and set it to Nothing.

The term ADO connection has several different and subtle meanings. When people talk about how good something is, they probably mean how much work it does in a given amount of time. For example, a good engine runs more stably and produces more power. You might also apply this criterion to development teams: a good team works quietly and produces a lot of high-quality code.

To me, ADO connection performance means at least two things--how well my code works, and how productive my development team and I are. In either case, the tips in this article will help: help you write code faster, help you write faster code--do it all quietly, and reduce errors of one kind or another. The tips presented in this article are primarily ADO oriented, specifically how to access SQL Server through ADO. But at the same time, I'll cover some broader COM tricks that apply to all ADO connection code you write.

I've spent a lot of time trying to understand which SQL Server data access coding techniques, which architectures, and which development habits to get the best performance from. In some cases, a single technology means little to the overall performance of an application unless we multiply the improvement in performance through cycles.

For example, in a client/service ADO connector application, we can save about one to two seconds when we connect to databases other than by specifying an ODBC data source (DSN). This time saving has little impact on the overall suitability or performance of the application. However, if we apply this technique to a middle-tier component that makes and closes database connections hundreds (or even thousands) of times per minute (or hour, or day), then this technique will significantly affect the performance of the system. So for each of the techniques I discuss here, be sure to consider this multiple factor--that is, how many times ADO connects your system to execute the same piece of code in a given period of time.

When you start looking for ways to improve performance ADO connectivity, consider where your application (component, or ASP code) spends most of its wait and processing time. If you find that your application spends a lot of time waiting for Open or Execute methods to complete, you should take a hard look at server-side query policies. All data providers, including ADO, wait the same amount of time for query results. For example, if you have a query, SQL Server takes 20 seconds to complete it.

No matter what interface is used to execute the query, no interface returns results faster than another. Although some interfaces open connections faster and others process result sets faster, none of these interfaces affect how quickly the database engine compiles and executes queries. So, if your ADO join query is too "challenging"--for example, you haven't optimized your index, you haven't used stored procedures, your server is overloaded, or you're asking for too many records to return--then no ADO technology in the world can help you improve performance. Unless you solve these basic query problems, no performance tuning technique will significantly improve overall performance. Query Analyzer for SQL Server is an excellent tool for analyzing query performance. It can graphically show query execution and suggest ways to improve performance.

If you are confident that queries are efficient, you can use the techniques described in this article to further tune ADO code performance. The tips presented here will help you simplify and improve ADO programming in various ways, including: creating and maintaining connections, constructing and submitting faster queries, improving ADO connection efficiency in processing query results, and more.

At this point, I believe everyone has a deeper understanding of "ADO connection to pay attention to what problems", may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report