Thoroughly solve the timeout problem of using ADO connection database in ASP

zhaozj2021-02-16  56

I am doing a C Builder management project, where the report system uses the TWEBBRowser control, calls the ASP file in the program, showing the statistics report, actually mitigate many troubles to do reports, the initial issue of not paying attention to user data volume, has been There is no problem, but as the data volume of the user has increased sharply, it has reached millions, especially when doing internal join queries, the ASP is as follows:

Microsoft VBScript compiler error error '800A03F6'

Lack of 'end'

/iishelp/common/500-100.asp, line 242

Active Server Pages Error 'ASP 0113'

Script timeout

/ Test/selfcountResult.asp

The maximum time of the script is running. You can modify this restriction or use IIS Administration Tool by specifying a server.scripttimeout property value.

In order to do not change the data structure (if you can use the method of adding a table, or using the stored procedure method, or using Job method, the test can be solved in the ASP, and many methods have been tried in the ASP. Finally, the test is successful, and my connection database is:

<%? DIM CNN, STRCNN, RS? SET CNN = Server.createObject ("adoDb.connection")? Cnn.connectionTIMEOUT = 999999? 'ADO connection timeout parameters, it is set to 0, it will not work, according to instructions, 0 should For unlimited time connections, but changed to a large number, is OK? Cnn.commandtimeout = 999999 ??? Server.scripttimeout = 99999? 'IIS script timeout? Session.timeout = 1440 ?????????? ??????????? ? 'Session timeout strCNN = "driver = {SQL Server}; server = 192.168.0.68; uid = sa; pwd = Sasa; Database = matq2008" err.clear? Cnn.open strcnnn? If err.number <> 0 THEN ?? response.write "Local database connection is incorrect, please check the database connection and parameter settings" ?? response.end? endiff

%> DIM CNN, STRCNN, RS SET CNN = Server.createObject ("AdoDb.Connection") cnn.connectionTIMEOUT = 999999 'ADO connection timeout set to infinite, original 0, not Spn.CommandTimeout = 99999 Server.scripttimeout = 99999 session.Timeout = 1440 strCNN = "driver = {SQL Server}; server = matQ; uid = sa; pwd = Sasasa; Database = MATQ2008" Err.Clear cnn.open strcn if err.number <> 0 Then Response.write "Local database connection is incorrect, please check the database connection and parameter settings" response.end endiff

I have made many experiments on my machine (IIS and databases on one machine), there is no problem when more than one million data volume, huh, huh, it is the statistics, the machine has no response! Of course this The method can solve an urgent problem, and the truly solving method should also optimize the data structure better.

Software Environment: Windows 2000 Professional SP4, IIS, .NET Framework1.1, SQL Server 2000 Personal Edition

转载请注明原文地址:https://www.9cbs.com/read-17169.html

New Post(0)