Search code examples
ms-accessasp-classic

classic asp - ms access update problem (The Microsoft Jet database engine stopped)


no problem for single user but I get the following errors when testing with multiple users at once.

ERROR 1 : The Microsoft Jet database engine stopped the process because you or another user tried to change the same data at the same time.

OR

ERROR 2 : Could not update; currently locked.

Set data = Server.CreateObject("ADODB.Connection") 
data.connectionstring = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="&Server.MapPath("db/db.mdb")
data.open 

set rs = server.CreateObject("adodb.recordset")
rs.open "select * from users where id="&user_id,data,1,3

rs("ip") = ip
rs.update

rs.close : set rs = NOthing : data.close : set data= NOthing

Solution

  • have you try:

    dim bensql
    bensql="select * from users where id="&user_id
    rs.Open bensql, data,3,3
    if not rs.eof then
        rs("ip") = ip
        rs.update
    end if
    rs.close
    

    maybe because another user tried to change the same data at the same time, query can't determine rs.eof or not