Delete Message with querystring

Results 1 to 3 of 3

Thread: Delete Message with querystring

  1. #1
    Join Date
    Dec 1969

    Default Delete Message with querystring

    i have encounter problem about delete message using querystring. i have create a table with a field that named it as id as data type autonumber. The following sql that i write to delete the message is:<BR><BR> messageid=Request.QueryString("messageid") <BR><BR>set rs=conn.Execute("DELETE * FROM tblMessage WHERE id =&#039; " & messageid &"&#039;") <BR><BR>however, the error message " data type is mismatch " in the sql statement. Please provide me some help and guidance on this problem. thank you.<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Delete Message with querystring

    IF id is numeric you cannot wrap it with quotes. try this..<BR>set rs=conn.Execute("DELETE * FROM tblMessage WHERE id =" & messageid )

  3. #3
    Join Date
    Dec 1969

    Default Autonumber is numeric

    thus there should net be any apostrophes<BR><BR>conn.Execute "DELETE * FROM tblMessage WHERE id =" & messageid,,128<BR><BR>As delete does not return any rows it is no use to create a recordset.<BR><BR>The form delete * from is only needed in Access 97 and will not work with any other database, so preferably use <BR><BR>conn.Execute "DELETE FROM tblMessage WHERE id =" & messageid,,128<BR><BR><BR>

Posting Permissions

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