Current location: Hot Scripts Forums » Programming Languages » ASP » deleting a message from forum


deleting a message from forum

Reply
  #1 (permalink)  
Old 10-14-03, 01:04 PM
pnqoma pnqoma is offline
New Member
 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
deleting a message from forum

guys plz help, my delete code doesn't work.i have a delete button on the message display board, whereby a msg is supposed to be deleted on the click of the button.Any suggestions??here's my code

Dim Conn, ConnString


set ConnString = server.createobject("adodb.connection")
conn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("forum1.mdb")&";"

'Create the Connection object
connString.open (conn)


if request("action") = "delete" then

sql = "DELETE* FROM messages WHERE id = '" & request("id")&"'"
Connstring.execute(sql)

Response.Write("<h1>The message has been deleted.</font><br>Back to <a href='forumlist.asp'>Forum</h1>")

Connstring.Close
end if
%>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-19-03, 02:44 AM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by pnqoma
guys plz help, my delete code doesn't work.i have a delete button on the message display board, whereby a msg is supposed to be deleted on the click of the button.Any suggestions??here's my code

Dim Conn, ConnString


set ConnString = server.createobject("adodb.connection")
conn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("forum1.mdb")&";"

'Create the Connection object
connString.open (conn)


if request("action") = "delete" then

sql = "DELETE* FROM messages WHERE id = '" & request("id")&"'"
Connstring.execute(sql)

Response.Write("<h1>The message has been deleted.</font><br>Back to <a href='forumlist.asp'>Forum</h1>")

Connstring.Close
end if
%>
In your DB, what data type if your ID column?
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-19-03, 09:09 AM
Stealth Stealth is offline
1337 pr0gr4mm3r
 
Join Date: Jun 2003
Location: Glasgow, Scotland
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
you dont need DELETE * FROM just DELETE FROM
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
which forum script? jonathen General HotScripts Site Discussion 15 03-14-05 12:48 AM
Remote forum hosting script Rbad750 Script Requests 3 09-29-03 07:46 PM
iHosts.com - Web Hosting forum Marcus Website Reviews 5 08-23-03 12:24 PM
Problem with CDONTS javadude2003 ASP 23 08-08-03 12:09 AM
A different type of forum software foo55 Script Requests 0 07-27-03 09:03 AM


All times are GMT -5. The time now is 12:22 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.