All on a sudden, can"t delete or update.
am 22.12.2004 11:01:09 von Asif Rahman
Hi:
Can someone please tell me why I'm getting this error? Previously the code
worked perfectly. All on a sudden, I can't delete or update.
----------------------------------------
Error Type:
Microsoft JET Database Engine (0x80004005)
Could not delete from specified tables.
/AprDelete.asp, line 16
The Code:
<%
Dim DB
Set DB = server.CreateObject ("ADODB.Connection")
DB.Mode=3
DB.Open ("Provider = Microsoft.Jet.OLEDB.4.0; Data Source= " +
"C:\database\corp.mdb")
DB.Execute ("Delete * from Appraised where ID=" & Request.QueryString("ID"))
%>
------------------------------
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the
provider, or of the selected locktype.
/AprProcess.asp, line 25
The Code:
<%
Dim DB
Set DB = server.CreateObject ("ADODB.Connection")
DB.Mode=adModeReadWrite
DB.Open ("Provider = Microsoft.Jet.OLEDB.4.0; Data Source= " +
"C:\database\corp.mdb")
Dim RS
Set RS = server.CreateObject ("ADODB.Recordset")
RS.Open "Select * from Appraised where ID=" & Request.Form("ID"), DB,2,2
RS.Fields("Client")=Request.Form ("Client")
RS.Fields("FinAm")=Request.Form ("FinAm")
RS.Fields("NatFin")=Request.Form ("NatFin")
RS.Fields("PurpFin")=Request.Form ("PurpFin")
dim myDate
if isDate(Request.Form ("DateProp")) = True then
myDate = cdate(Request.Form ("DateProp"))
RS.Fields("DateProp") = day(myDate) & " " & monthname(month(myDate)) & "
" & year(myDate)
else
RS.Fields("DateProp") = "Not entered"
End if
'RS.Fields("DateProp")=Request.Form ("DateProp")
RS.Fields("Status")=Request.Form ("Status")
RS.Update
RS.Close
Set RS = nothing
%>
-----------------------------------------------
Thanks in advance.
Asif
Re: All on a sudden, can"t delete or update.
am 22.12.2004 18:12:16 von Mark Schupp
First remove the "*" the correct SQL statement should be
"Delete from Appraised where ID=" & Request.QueryString("ID")
If that doesn't make any difference you should check that the NTFS
permissions on the database directory and its contents have not changed.
Next I would suspect file damage to the database. Try doing a repair.
--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Asif Rahman" wrote in message
news:%23$ug03A6EHA.3472@TK2MSFTNGP09.phx.gbl...
> Hi:
>
> Can someone please tell me why I'm getting this error? Previously the code
> worked perfectly. All on a sudden, I can't delete or update.
>
> ----------------------------------------
> Error Type:
> Microsoft JET Database Engine (0x80004005)
> Could not delete from specified tables.
> /AprDelete.asp, line 16
>
> The Code:
> <%
> Dim DB
> Set DB = server.CreateObject ("ADODB.Connection")
> DB.Mode=3
> DB.Open ("Provider = Microsoft.Jet.OLEDB.4.0; Data Source= " +
> "C:\database\corp.mdb")
>
> DB.Execute ("Delete * from Appraised where ID=" &
> Request.QueryString("ID"))
> %>
> ------------------------------
>
> Error Type:
> ADODB.Recordset (0x800A0CB3)
> Current Recordset does not support updating. This may be a limitation of
> the provider, or of the selected locktype.
> /AprProcess.asp, line 25
>
>
> The Code:
> <%
> Dim DB
>
> Set DB = server.CreateObject ("ADODB.Connection")
> DB.Mode=adModeReadWrite
> DB.Open ("Provider = Microsoft.Jet.OLEDB.4.0; Data Source= " +
> "C:\database\corp.mdb")
>
> Dim RS
>
> Set RS = server.CreateObject ("ADODB.Recordset")
>
> RS.Open "Select * from Appraised where ID=" & Request.Form("ID"), DB,2,2
>
> RS.Fields("Client")=Request.Form ("Client")
> RS.Fields("FinAm")=Request.Form ("FinAm")
> RS.Fields("NatFin")=Request.Form ("NatFin")
> RS.Fields("PurpFin")=Request.Form ("PurpFin")
>
> dim myDate
> if isDate(Request.Form ("DateProp")) = True then
> myDate = cdate(Request.Form ("DateProp"))
> RS.Fields("DateProp") = day(myDate) & " " & monthname(month(myDate)) & "
> " & year(myDate)
> else
> RS.Fields("DateProp") = "Not entered"
> End if
> 'RS.Fields("DateProp")=Request.Form ("DateProp")
>
> RS.Fields("Status")=Request.Form ("Status")
>
> RS.Update
> RS.Close
> Set RS = nothing
> %>
> -----------------------------------------------
> Thanks in advance.
> Asif
>
Re: All on a sudden, can"t delete or update.
am 18.01.2005 09:04:48 von Bullschmidt
<<
Error Type:
Microsoft JET Database Engine (0x80004005)
>>
Sounds like perhaps the permissions for the folder containing the
database need to be tweaked.
Why do I get database-related 80004005 errors?
http://www.aspfaq.com/show.asp?id=2009
Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!