read200 참고해서 버튼 만들기
<html>
<head>
<meta http-equiv = "Refresh" content="3">
<style>
#lbhead {background-color: beige}
#lghead {background-color: powderblue}
</style>
<base target="_self">
</head>
<body>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = "DSN=chat.dsn"
Conn.Open
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open "Select * From IdeaTime Order By id Desc", Conn
%>
<table border="0" width="700">
<%
while not Rs.eof
%>
<tr <% If Rs("id") Mod 2 = 0 Then %> id="lbhead" <% Else %> id="lghead" <% End If %>>
<td height="3">
<form method="post" action="creaddelete.asp">
<p>
<input type="hidden" name="txtid" value="<%=Rs("id")%>">
<input type="submit" name="formbutton1" value="D">
</p>
</form>
</td>
<td width="200" height="3">
<%=Rs("Idea")%>
</td>
</tr>
<%
Rs.movenext
Wend
Rs.close
set Rs=nothing
Conn.close
Set Conn=nothing
%>
</body>
</html>
delete2 참고해서 creaddelete.asp 만들기
creaddelete.asp
<%
X=CInt(Request.Form("txtid"))
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = "DSN=chat.dsn"
Conn.Open
sql = "DELETE * FROM ideaTime WHERE id = " & X & ";"
Conn.execute(sql)
Conn.Close
Set Conn=nothing
Response.Redirect "cread.asp"
%>
<base target="_self"> 고정시켜줌