Trouble deleting a recordset in a database......

Results 1 to 2 of 2

Thread: Trouble deleting a recordset in a database......

  1. #1
    Join Date
    Dec 1969

    Default Trouble deleting a recordset in a database......

    When my script tries to delete a recordset from my database, I get the following error:<BR><BR>---------------------------------------------------------------<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80004005&#039; <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 7. <BR><BR>/adminoverstocktest.asp, line 89 <BR>---------------------------------------------------------------<BR><BR><BR>Below is my code for deleting the recordset, I&#039;ll point out where line 89 is:<BR><BR>---------------------------------------------------------------<BR>If (Request.Form("Action")= "Delete") Then<BR> <BR> strID = CInt(Request.Form("ID"))<BR> <BR><BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:hshomeizimageizimages.netedgemate .mdb"<BR> objConn.Open<BR> Set objRS = Server.CreateObject("ADODB.Recordset")<BR> objRS.Open "overstock", objConn, , adLockOptimistic, adCmdTable<BR> <BR> <BR> Do While (Not objRS.EOF)<BR><BR> If (objRS("ID") = strID) Then <BR> <BR> strProduct = objRS("Product")<BR> line 89----&#062; objRS.Delete<BR> Response.Write "The product: " & strProduct & " was deleted from the overstock table successfully."<BR> <BR> End If<BR> <BR> objRS.MoveNext<BR> Loop <BR> <BR> <BR> objRS.Close<BR> Set objRS = Nothing<BR> objConn.Close<BR> Set objConn = Nothing <BR> <BR> <BR> <BR> End If<BR>---------------------------------------------------------------<BR><BR>Thanks for your help.

  2. #2
    Join Date
    Dec 1969

    Default RE: Trouble deleting a recordset in a database....

    personally I dislike this type of query. I&#039;d go with the normal SQl<BR><BR>AS IN<BR><BR>Delete from &#060;table&#062; where ID = " & ID

Posting Permissions

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