New starter - DELETE problems

Results 1 to 2 of 2

Thread: New starter - DELETE problems

  1. #1
    Join Date
    Dec 1969

    Default New starter - DELETE problems

    Hello, <BR><BR>Im using the Javascript code below to allow users to select the records they want to delete:<BR><BR><BR>function Row&#060;% Response.Write Trim(rsCurrent("EditName")) %&#062;_Click()<BR>{<BR> var el = window.event.srcElement;<BR> for ( ; != "ActiveRow"; el = el.parentElement);<BR> var prev =;<BR> if (prev != "#500000") {<BR> frmDisable.SelectedRec&#060;% Response.Write Trim(rsCurrent("EditName"))%&#062;.value = "&#060;%Response.Write Trim(rscurrent("EditName"))%&#062;"; <BR> = "#500000";<BR> = "#FFFF00"<BR> }<BR> else {<BR> frmDisable.SelectedRec&#060;% Response.Write Trim(rsCurrent("EditName")) %&#062;.value = ""; <BR> = "#EEEEEE";<BR> = "#000000"<BR> }<BR>}<BR><BR><BR>Once they have clicked on the record, the row will be black and the lettering yellow (#ffff00) <BR>Then they press a "Remove" button to delete that row : <BR><BR>&#060;input type="submit" name = "Action" value="Remove"&#062;<BR>&#060;/form&#062;<BR><BR>&#060;%<BR>Action = UCase(Request("Action"))<BR><BR>If Action = "REMOVE" then<BR><BR><BR>If (Trim(Request.Form("SelectedRec" & Trim(Rscurrent("EditName")))) &#060;&#062; "") then<BR><BR>SQLQuery = "DELETE FROM Assessor WHERE EditName = &#039"<BR>SQLQuery = SQLQuery & Request.Form("SelectedRec" & Trim(rscurrent("EditName"))) & "&#039"<BR><BR>Set rscurrent = dbConn.Execute (SQLQuery)<BR> <BR>End if<BR>rscurrent.close<BR><BR>Its not working so Im thinking that the SQL is all wrong. <BR>Can you help out? <BR>

  2. #2
    BobR Guest

    Default RE: New starter - DELETE problems

    Have you looked at the output of SQLQuery? Comment out the execute and put in a response.write SQLQuery so you can see if the sql statement looks correct. I would suspect that you want to concatenate the form field SelectedRec with the database field EditName more like this: ... Request.Form("SelectedRec") & Trim(rscurrent("EditName"))&"&#039"

Posting Permissions

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