有类似海盗王的游戏么:ASP的问题,表单中输入的内容跟显示出来的不一样。

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/03 13:49:51
<!--#include file="conn.asp"-->
<!--#include file="verify.asp"-->
<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "No-Cache"
%>

<%
if request.QueryString("ready")="yes" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from content"
rs.open sql,conn,1,3
rs.addnew
rs("huodaigongsi")=trim(request("huodaigongsi"))
rs("tidanhao")=trim(request("tidanhao"))
rs.update
rs.close
set rs=nothing
%>
<script language="javascript">
alert("添加数据成功!")
window.location.href="product.asp"
</script>
<% end if %>

<html>
<head>
<title></title>
</head>
<body>
<form name="wupinbiao" action="?ready=yes" method="post">
货代公司:<input name="huodaigongsi" type="text" value=""/>
提单号:<input name="tidanhao" type="text" value=""/>
<input name="tianjiashuju" type="submit" value="添加数据" />
<input name="qingchu" type="reset" value="清除数据" />

</form>
</body>
</html>

在name为huodaigongsi的文本框中,输入任何字符,在数据打印页上面显示的都是0,检查不出哪里有错误,tidanhao可以正常显示,郁闷了,不知道添加页哪里代码错误。。。有高手知道不,指教啊
用的是access2000,数据库里的huodaigongsi字段是文本型的,都试过了,还是老样子,昏啊

用的什么数据库?看看数据库中huodaigongsi这个字段的属性是不是有问题?

可能是数据类型的问题,表单文本框中为字符型,而数据库中为数值型,转换一下试试,加一个Cint函数:
rs("huodaigongsi")=cint(trim(request("huodaigongsi")) )