Forums

ASP

This topic is locked

delete error!!!

Posted 14 Jan 2006 16:29:32
1
has voted
14 Jan 2006 16:29:32 likez praise posted:
hi guys....
whats wrong with this code... every time i'll use this it deletes the whole content of the database, instead of deleting only the record i choose.

<%
Dim msgid
msgid = Request.Form("msgid"

Dim Conn
Dim Rs
Dim sql
Set Conn = Server.CreateObject("ADODB.Connection"
Set Rs = Server.CreateObject("ADODB.Recordset"
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("blog.mdb" & ";"
sql= "Delete FROM messagetable WHERE 'msgid='"& msgid &""
Rs.Open sql, Conn
Conn.Close
Set Conn = Nothing
Response.redirect "adminshowmain.asp?sortby=msgid"
%>

Can anybody enlighten me with this problem??

thanks <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Replies

Replied 15 Jan 2006 16:16:24
15 Jan 2006 16:16:24 allan khalil replied:
Im no guru and still learning this stuff my self... but the problem might be in your query string / runtime value?
Replied 24 Jan 2006 12:24:11
24 Jan 2006 12:24:11 Tom Theys replied:
try this

sql= "Delete FROM messagetable WHERE msgid=" & msgid

Reply to this topic