ASP timeout Processing

Source: Internet
Author: User

ASP and MSSQL are used for database applications all the time. Generally, there is no problem. However, in some projects, the data volume will be large. As the data volume increases, a timeout problem may occur. I have read a lot of information, and I have summarized the cause and solution of the timeout. I hope you can refer to it for reference.

The causes of server timeout are as follows:
1. server. scripttimeout
2. connectiontimeout attribute of the connection object
3. commandtimeout attribute of the command object

The following is a solution:
1. server. scripttimeout
Server. scripttimeout, specifies the execution time of the local file. The default value is 90 seconds.
<%
Server. scripttimeout = 180
%>
2. connectiontimeout attribute of the connection object
Connectiontimeout: Specifies the database connection time. The default value is 15 seconds.
<%
Set conn = server. Createobject ("ADODB. Connection ")
Conn. connectionstring = "provider = Microsoft. Jet. oledb.4.0"
Conn. connectiontimeout = 30
Conn. Open Server. mappath ("database. mdb ")
%>

3. commandtimeout attribute of the command object
'Commandtimeout. The default value is 30 seconds.
<%
Conn. commandtimeout = 60
%>


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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.