A detailed description of ADO timeout related issues

Source: Internet
Author: User
Tags odbc

Timed out using connection ADO. The combination of functional language and object-oriented programming language, and perfect for programming, algorithms, technology and exploratory development, so you can use the process of feeling interesting and attractive.

Make connection ADO Timeout

A sudden increase in activity may make the database server unwieldy and greatly increase the time it will be to establish a database connection. As a result, an extended connection delay reduces the performance of the database, and with the connectiontimeout of the connection object, you can limit the time the application waits before discarding the connection attempt and sending an error message. For example, the following script sets the ConnectionTimeout property to wait 20 seconds before canceling the connection attempt:

Set cn=server.createobject ("ADODB. Connection ") cn. ConnectionTimeout = CN. Open "FILEDSN=MyDatabase.dsn" no one can read a lot of data at the same time, like the next page or countless pages such as the form I do not know how many people will go to see, so to improve the efficiency of ADO, can not use simple timeout to control, should be comprehensive. I suggest you make a lot of use of the search form, only a certain number of results can be.

is not a lot of records, instead of a large number of data processing after the summary, a query statement after optimization still need more than 30 seconds, ADO timeout and ASP timeout in 30 seconds quasi-times wrong, Timeout I have tried but no effect, I was connected to SQL Server 7.0 through ODBC Again in ASP with ADO with ODBC, I do not know whether these data sources support this attribute, if not supported, whether there are other methods, thank you for your reply!

When using a strongly typed DataSet, you can annotate the dataset's XML Outline definition language (XSD) to ensure that the strongly typed dataset correctly handles null (NULL) references. A null value (nullvalue) annotation enables you to replace DBNull with a specific value of String.Empty, keep a null reference, or produce an exception. When you choose which of these depends on the content of your application, an exception is generated by default when a null reference is encountered.

Refreshing data in a dataset

Use DataAdapter.Fill if you want to refresh the values in the dataset from the server using the updated values. If the primary key is defined on the datasheet, DataAdapter.Fill matches the new row based on the primary key and changes the server's data to the existing row. The RowState of the refreshed row is set to unchanged, even though it has been modified before the refresh. Note If you define a primary key for a datasheet, adding a new row to the Dataadapter.fillado timeout may duplicate the primary key value.

One technique for returning only one page of records at a time is to create an SQL statement that contains a where and an ORDER BY clause with a top decision. This technique relies on methods that identify each unique row. When navigating to a record on the next page, modify the WHERE clause to include all records with a unique identity larger than the current page identity;

When navigating to the previous page, modify the WHERE clause to include all records with a unique identity smaller than the current page identification. For both queries, only records for the top page of the record are returned. When you navigate to the previous page, you need to sort the records in descending order, which returns the page at the end of the query (if you want to reorder the records before you display them).

Another technique is to create a SELECT statement that contains top judgments and Embedded SQL statements. This technique does not ADO timeout is based on the unique method of identifying each row. The first step in using this technique is to multiply the size of the page by the number of pages you want. The value is then passed to the top decision of the SQL query and sorted in ascending order. The query is then embedded in another query, which selects the top page size from the embedded query results in descending order. Essentially, the end page of the embedded query is returned.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

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.