I'm trying to delete a record ..
delete.asp:
Here is my html:
I get this message telling me it was successfully deleted. But when I check my db .. the record is still there. I trigger this page with a button:
I think the problem is my code doesn't know which Rs to delete. I may add a filter, but I dont know how to pass a value along with a button click
Any thoughts?
[red]Tools | Internet Options | Clear History[/red]
delete.asp:
Code:
<% Response.Buffer = True %>
<!-- #include virtual="/<mynet>adovbs.inc" -->
<!-- #include virtual="/<mynet>db.asp" -->
<%
Set Conn = Server.CreateObject( "ADODB.Connection" )
Conn.Open "MyDSN"
MySQL = "SELECT * FROM MyTable"
Set Rs = Server.CreateObject( "ADODB.Recordset" )
Rs.Open MySQL, Conn, adOpenStatic, adLockOptimistic
Rs.Delete([adAffectCurrent])
Rs.Close
Set Rs = Nothing
%>
Here is my html:
Code:
<html>
<head>
<meta http-equiv = "refresh" content="3.0; URL = [URL unfurl="true"]http://<myweb>/edit.asp">[/URL]
<title>Inventory Record Change Success</title>
</head>
<body>
<%
Response.Write "<h3><b>" & "The current record has just been removed from the RecordSet" & "</b></h3>"
%>
</body>
</html>
Code:
<input type = "button" name = "delete" value = "DELETE THIS RECORD" onclick = "javascript:window.location='[URL unfurl="true"]http://<myweb>delete.asp'">[/URL]
I think the problem is my code doesn't know which Rs to delete. I may add a filter, but I dont know how to pass a value along with a button click
Any thoughts?
[red]Tools | Internet Options | Clear History[/red]