主题:新手问题 Update 的意思
请问Rs.Update什么意思啊,为什么要加这个?另外,我要在这个框框里加一个提示怎么加啊,就是说当我添加数据库成功了,就弹出一个警告窗口,内容就是:留言成功!
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留言本</title>
<style type="text/css">
<!--
.style1 {font-size: 12px}
.style2 {font-size: 12px; font-weight: bold; }
body {
background-color: #666666;
}
-->
</style>
</head>
<body>
<%
title = request.Form("title")
if title<>"" then
set rs = server.CreateObject("adodb.recordset")
rs.open "lyb",conn,3,3
rs.addnew
rs("Title") = title
rs("Content") = request.Form("content")
rs("DataTime") = Now()
rs.update
end if
%>
<form name="form1" method="post" action="">
<p align="center" class="style2">留言本 - 添加留言内容</p>
<table width="479" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF">
<td width="86" bgcolor="#CCCCCC"><div align="center"><span class="style1">标题:</span></div></td>
<td width="304" height="30" bgcolor="#CCCCCC"><input name="title" type="text" id="title" size="20"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#CCCCCC"><div align="center"><span class="style1">内容:</span></div></td>
<td bgcolor="#CCCCCC"><textarea name="content" cols="50" rows="20" id="content"></textarea></td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="提交">
<input type="button" name="Submit" value="查看留言" onClick="location.href='ShowContent.asp'">
<input type="reset" name="Submit" value="重置">
</div></td>
</tr>
</table>
</form>
</body>
</html>
十分感谢。告诉我在哪个位置加就可以了。
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留言本</title>
<style type="text/css">
<!--
.style1 {font-size: 12px}
.style2 {font-size: 12px; font-weight: bold; }
body {
background-color: #666666;
}
-->
</style>
</head>
<body>
<%
title = request.Form("title")
if title<>"" then
set rs = server.CreateObject("adodb.recordset")
rs.open "lyb",conn,3,3
rs.addnew
rs("Title") = title
rs("Content") = request.Form("content")
rs("DataTime") = Now()
rs.update
end if
%>
<form name="form1" method="post" action="">
<p align="center" class="style2">留言本 - 添加留言内容</p>
<table width="479" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF">
<td width="86" bgcolor="#CCCCCC"><div align="center"><span class="style1">标题:</span></div></td>
<td width="304" height="30" bgcolor="#CCCCCC"><input name="title" type="text" id="title" size="20"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#CCCCCC"><div align="center"><span class="style1">内容:</span></div></td>
<td bgcolor="#CCCCCC"><textarea name="content" cols="50" rows="20" id="content"></textarea></td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="提交">
<input type="button" name="Submit" value="查看留言" onClick="location.href='ShowContent.asp'">
<input type="reset" name="Submit" value="重置">
</div></td>
</tr>
</table>
</form>
</body>
</html>
十分感谢。告诉我在哪个位置加就可以了。