Is this "delete" code right?

Results 1 to 3 of 3

Thread: Is this "delete" code right?

  1. #1
    KH Guest

    Default Is this "delete" code right?

    I am trying to delete a record from a SQL Server db table. I am not getting any errors, but the record does not delete when submitted. There is a simple one field form called Record ID where authorized persons can delete records..I was under the impression that a recordset object is not needed for this.<BR>Here&#039s the code:<BR>&#060;%<BR>Dim Conn<BR>Dim strQuery<BR>set Conn = Server.CreateObject("ADODB.Connection")<BR>Conn.Op en "training", "sa", ""<BR>strQuery = "DELETE FROM Courses WHERE RecordID = Request("RecordID")"<BR>strQuery.Execute<BR>......

  2. #2
    Join Date
    Dec 1969

    Default RE: Is this

    Your problem is when you are creating the SQL statement.<BR><BR>strQuery = "DELETE FROM Courses WHERE RecordID = Request("RecordID")"<BR><BR>SB ...<BR>strQuery = "DELETE FROM Courses WHERE RecordID = " & Request("RecordID")<BR><BR><BR>HTH<BR><BR>Jerry<BR >

  3. #3
    KH Guest

    Default RE: Is this

    Thanks Jerry :)

Posting Permissions

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