A deadlock occurs when ASP operates an Access database. LDB Solutions _ Application Techniques
Source: Internet
Author: User
So I landed the management panel of the host, restarted the website service, the ldb file disappears, the website opens also normal, but after a few hours, the website again appeared above situation, this kind of situation lasted for a long time, the website was later blocked by the virtual host's supplier, Feedback to me is because my site is running a lot of CPU resources, so temporarily shielded, let me to the Web site program or database optimization.
Baidu search on this aspect of the situation, the results are many, summed up mainly because of the database after access, did not release the record set and disconnected the database, the following talk about the standard way to operate an Access database:
1. Database connection method: Conn.asp
<%
Dim conn
Dim connstr
Dim db
db= "Database/data.mdb"
Set conn = Server.CreateObject ("ADODB. Connection ")
Connstr= "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & Server.MapPath ("&db&")
Conn. Open ConnStr
If ERR Then
Err. Clear
Set Conn = Nothing
Response.Write The server is maintaining, please try again later. "
Response.End
End If
Sub Closeconn ()
' The following is a disconnected database connection statement
Conn.close
Set conn=nothing
End Sub
%>
2. Turn off the release recordset
Rs.close
Set rs=nothing
3, disconnect the database
Conn.close
Set conn=nothing
Combined with the above three content, the following standard method for operating an Access database is obtained test.asp
<!--#include file= "conn.asp"-->
<%
Sql= "SELECT * FROM table order by id"
Set Rs=server.createobject ("Adodb.recordset")
Rs.Open sql,conn,1,1
If not rs.eof then
Tel=rs ("tel")
Fax=rs ("Fax")
End If
' Below closes and releases the recordset statement
Rs.close
Set rs=nothing
' Call Disconnected database connection child function
Call Closeconn ()
%>
According to this standard, I am on my website procedures for the carpet-type of troubleshooting, trapping, finally my site is finally a normal access, there is no previous database deadlock situation.
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