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
%>