simple delete function

Results 1 to 3 of 3

Thread: simple delete function

  1. #1
    Join Date
    Dec 1969

    Default simple delete function

    *<BR>This page was working correctly before I changed to another web-server. But now I get this error:<BR>-------------------------------------------------<BR>ADODB.Recordset.1 error &#039;80004005&#039; <BR><BR>SQLState: 34000<BR>Native Error Code: 0<BR>[INTERSOLV][ODBC SequeLink driver]Statement with cursor named in this statement&#039;s CURRENT-OF-CURSOR clause is not a SELECT FOR UPDATE.<BR><BR><BR>/admin/delete.asp, line 11<BR><BR>------------------------------------------------------<BR>This page should delete a post in the database:<BR>check out:<BR>(Change ID to anything between 1-160)<BR><BR>This similar page works fine:<BR><BR>It calls add.asp and adds a post in the db.<BR><BR>Here&#039;s the code for "delete.asp":<BR>----------------------------------------------------<BR>&#060;!-- #include virtual="applications/" --&#062;<BR>&#060;%<BR>Set conn = Server.CreateObject("ADODB.Connection")<BR>conn.Op en "Provider=Microsoft.Jet.OLEDB.4.0; DSN=d2152-k;Password=@01#$gakakhlaknddkkbhla"<BR><BR><BR>Set rs = Server.CreateObject("ADODB.Recordset")<BR>tabort = "SELECT * FROM deltagare WHERE ID=" & Request.QueryString("ID") & " "<BR>rs.Open tabort, conn, adLockOptimistic, adOpenStatic<BR> <BR>rs.Delete<BR><BR>rs.close <BR>Set rs = Nothing <BR>conn.close <BR>Set conn = Nothing<BR><BR>Response.Redirect ""<BR>%&#062;<BR>---------------------------------------------------------<BR>the request for "ID" works fine, I&#039;ve checked.<BR><BR>I&#039;ve got the same problem with "deltagare.asp", a page that should be able to edit the posts...<BR><BR>I&#039;d be very grateful if anyone could help me, I&#039;m going crazy..<BR><BR>/Johan

  2. #2
    Join Date
    Dec 1969

    Default RE: simple delete function

    Try changing the cursor type. Why are you using a recordset for a delete anyway? Would&#039;t the following be more effecient and manageable:<BR><BR>Set conn = Server.CreateObject("ADODB.Connection")<BR>conn.Op en "Provider=Microsoft.Jet.OLEDB.4.0; DSN=d2152-k;Password=@01#$gakakhlaknddkkbhla"<BR><BR>tabort = "SELECT * FROM deltagare WHERE ID=" & Request.QueryString("ID")<BR><BR>conn.execute(tabo rt)<BR><BR>conn.close <BR>Set conn = Nothing<BR>

  3. #3
    Join Date
    Dec 1969

    Default Hej

    Use plain sql for these operations<BR><BR>Set conn = Server.CreateObject("ADODB.Connection")<BR>conn.Op en "Provider=Microsoft.Jet.OLEDB.4.0; DSN=d2152-k;Password=@01#$gakakhlaknddkkbhla"<BR><BR>conn.ex ectute "delete from deltagare where id = " & Request.QueryString("ID"),,128

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts