I was wondering if someone could help me out on this. I have searched all day and can't find an answer.
I have one delete.asp file that pulls from a data base and allows me to select a record to be deleted. Here is the code:
<%
Dim Conn, Rs, sql
Set Conn = Server.CreateObject("ADODB.Connection"
Set Rs = Server.CreateObject("ADODB.Recordset"
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/forms/aimd/aimd.mdb"
sql= "SELECT * FROM Mishap_tbl;"
Rs.Open sql, Conn
Response.Write "<FORM name='Delete' method='post' action='Delete-rec.asp' onsubmit='return confirmdel()'>"
Response.Write "<table border=1 cellspacing=0>"
Response.Write "<tr>"&"<td colspan='5' align='center'>"&"Select a Record to <b> delete </b> and click delete"&"</td>"&"</tr>"
Response.Write "<tr>"&"<th align='center' colspan='2'>"&"Last Name"&"</th>"&"<th align='center'>"&"First Name"&"</th> "&"<th align='center'>"&"Report Date"&"</th>"&"<th align='center'>"&"Record ID"&"</th>"&"</tr>"
if NOT Rs.EOF then
Do While not Rs.EOF
Response.Write ("<tr>"
Response.Write ("<td>"&"<input type='radio' name='IDKey' value="&Rs("ID"
&">"&"</td>"
Response.Write ("<td>"&Rs("LastName"
&"</td>"
Response.Write ("<td>"&Rs("FirstName"
&"</td>"
Response.Write ("<td>"&Rs("RDate"
&"</td>"
Response.Write ("<td>"&Rs("ID"
&"</td>"
Response.Write ("</tr>"
Rs.MoveNext
Loop
else
Response.Write("No records found"
end if
Response.Write("<tr>"&"<td colspan='5' align='center'>"&"<input type ='submit' name='submit' value='Delete selected record'>"&"</td>"&"</tr>"
Response.Write "</table>"
Rs.Close
Set Rs = Nothing
Set Conn = Nothing
Response.Write "</form>"
%>
</body>
</html>
The delete works fine. The Delete-rec.asp page works fine and deletes the page. The Problem: When the user presses "back" to view the record he just deleted, the record is still there. If the user presses refresh, he then can see that the record is gone. How do I make the record disappear imediatly? Next question: How do I order the list by record ID?
Any help would be greatly appreciated. This site is awsome.
Thanks,
Al
I have one delete.asp file that pulls from a data base and allows me to select a record to be deleted. Here is the code:
<%
Dim Conn, Rs, sql
Set Conn = Server.CreateObject("ADODB.Connection"
Set Rs = Server.CreateObject("ADODB.Recordset"
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/forms/aimd/aimd.mdb"
sql= "SELECT * FROM Mishap_tbl;"
Rs.Open sql, Conn
Response.Write "<FORM name='Delete' method='post' action='Delete-rec.asp' onsubmit='return confirmdel()'>"
Response.Write "<table border=1 cellspacing=0>"
Response.Write "<tr>"&"<td colspan='5' align='center'>"&"Select a Record to <b> delete </b> and click delete"&"</td>"&"</tr>"
Response.Write "<tr>"&"<th align='center' colspan='2'>"&"Last Name"&"</th>"&"<th align='center'>"&"First Name"&"</th> "&"<th align='center'>"&"Report Date"&"</th>"&"<th align='center'>"&"Record ID"&"</th>"&"</tr>"
if NOT Rs.EOF then
Do While not Rs.EOF
Response.Write ("<tr>"
Response.Write ("<td>"&"<input type='radio' name='IDKey' value="&Rs("ID"
Response.Write ("<td>"&Rs("LastName"
Response.Write ("<td>"&Rs("FirstName"
Response.Write ("<td>"&Rs("RDate"
Response.Write ("<td>"&Rs("ID"
Response.Write ("</tr>"
Rs.MoveNext
Loop
else
Response.Write("No records found"
end if
Response.Write("<tr>"&"<td colspan='5' align='center'>"&"<input type ='submit' name='submit' value='Delete selected record'>"&"</td>"&"</tr>"
Response.Write "</table>"
Rs.Close
Set Rs = Nothing
Set Conn = Nothing
Response.Write "</form>"
%>
</body>
</html>
The delete works fine. The Delete-rec.asp page works fine and deletes the page. The Problem: When the user presses "back" to view the record he just deleted, the record is still there. If the user presses refresh, he then can see that the record is gone. How do I make the record disappear imediatly? Next question: How do I order the list by record ID?
Any help would be greatly appreciated. This site is awsome.
Thanks,
Al