新西兰国家党:asp sql server 2000

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 15:08:05
======huifu.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {
font-size: 24px;
color: #999966;
}
-->
</style>
</head>

<body>
<%
num1 = request("num")
%>
<table width="973" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="233" height="82"> </td>
<td width="547"> </td>
<td width="193"> </td>
</tr>
<tr>
<td height="357"> </td>
<td valign="top"><form id="form1" name="form1" method="post" action="write.asp?num=<%=num1%>">

<p class="STYLE1">你要回答的问题的号码是:<%=num1%></p>
<p class="STYLE1">你的昵称:
<input name="hfname" type="text" size="10" maxlength="10" />
</p>
<p class="STYLE1">答案:<br />
<label>
<textarea name="da" cols="50" rows="7"></textarea>
</label>
</p>
<label></label>
<label>
<input type="submit" name="Submit" value="回复完毕" />
</label>
<label>
 
<input type="reset" name="Submit2" value="重写" />
</label>
</form> <p class="STYLE1"> </p> </td>
<td> </td>
</tr>
<tr>
<td height="44"> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>

====write.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>

<%
num = request("num")
response.Write num & "<br>"
name1 = request("hfname")
response.Write name1 & "<br>"
daan = request("da")
response.Write daan

%>

<!-- #include file = "conn.asp" -->
<%
dim rs
set rs = server.CreateObject("adodb.recordset")
sqlstr = "select * from huifu"
rs.open sqlstr,conn,1,1
str = "insert into huifu values ('"num"',name1,daan)"
rs.execute
%>
</body>
</html>

write.asp中已经接收到了num,name1,daan
但在插入数据库的时候老是出错,不知道是为什么啊,那位能帮帮忙忙看看?