| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 356 人关注过本帖
标题:这是哪里出了问题啊?
只看楼主 加入收藏
白永浩
Rank: 1
来 自:浙江温州
等 级:新手上路
帖 子:101
专家分:0
注 册:2006-3-23
收藏
 问题点数:0 回复次数:2 
这是哪里出了问题啊?

我的这段写入ACCESS的代码到底是哪里出错了啊?为什么只有product,productn两个字段是写得进去的?
<%

if request.querystring("action")="checkdd_cn" then

companyname=request("tcompanyname")
customername=request("tcustomername")
tcustomersex=request("tcustomersex")
tcustomertel=request("tcustomertel")
tcustomeremail=request("tcustomeremail")
tproduct=request("tproduct")
tproductn=request("tproductn")
tspdate=request("tspdate")


set rs=server.createobject("adodb.recordset")
sqlstr="select * from byh_customer"
rs.Open sqlstr,conn,3,3

rs.addnew
rs("ccompany")=companyname
rs("cname")=customername
rs("csex")=tcustomersex
rs("ctel")=tcustomertel
rs("cemail")=tcustomeremail
rs("product")=tproduct
rs("productn")=tproductn
rs("交货日期")=tspdate
rs("填单日期")=now()
rs.update
rs.close
set rs=nothing
set conn=nothing
%>


<script language=vbscript>
msgbox "提交成功!"
window.location="wsdd_cn.asp"

</script>

<%end if%>

<head>
<title><%=byh_site_name%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="<%=byh_site_key%>">

<LINK href="style.css" type=text/css rel=stylesheet>
</head>

<body background="kl_image/topbg.jpg">
<!--#include file="top_cn.asp"-->


<TABLE width=778 height=490 border=0 align="center" cellPadding=0 cellSpacing=0 id=table1>
<TBODY>
<TR>
<TD vAlign=top align=middle width=778>

<TABLE id=table23 height=198 cellSpacing=0 cellPadding=0 width=778
border=0>
<TBODY>
<TR>
<TD align=middle width=180 rowSpan=4 height="55"> <!--#include file="left_cn.asp"--> </TD>
<TD width=598 colSpan=3 height=34> <P align=center><FONT color=#cc3300 size=3>
网上订单</FONT></P></TD>
</TR>
<TR>
<TD vAlign=top width=598 colSpan=3 height=12></TD>
</TR>
<TR>
<TD width=68 height="33"></TD>
<TD vAlign=top width=462 height="33">

<form method="POST" action="?action=checkdd_cn">

<%

tcompanyname=request("companyname")
tcustomername=request("customername")
tcustomersex=request("customersex")
tcustomertel=request("customertel")
tcustomeremail=request("customeremail")
tproduct=request("product")
tproductn=request("productn")
tspdate=request("spdate")


if tcompanyname ="" then%>
<script language="vbScript">msgbox "对不起,公司名不能为空!"
window.history.go(-1)
</script>
<% response.End()
end if
if tcustomername ="" then%>
<script language="vbScript">msgbox "对不起,用户名不能为空!"
window.history.go(-1)
</script>
<%response.End()
end if

if tcustomertel ="" then%>
<script language="vbScript">msgbox "对不起,电话号码不能为空!"
window.history.go(-1)
</script>
<%response.End()
end if

if tproduct ="" then%>
<script language="vbScript">msgbox "对不起,产品型号不能为空!"
window.history.go(-1)
</script>
<%response.End()
end if

if tproductn ="" then%>
<script language="vbScript">msgbox "对不起,定做数量不能为空!"
window.history.go(-1)
</script>
<%response.End()
end if

if tspdate ="" then%>
<script language="vbScript">msgbox "对不起,交货日期不能为空!"
window.history.go(-1)
</script>
<%response.End()
end if


%>

<p>您填写的内容是:</p>
<table border="1" width="50%" height="142">
<tr>
<td width="50%" height="12">公司名称:</td>
<td width="50%" height="12"><%=tcompanyname%> <input type=hidden name=tcompany value=<%=tcompanyname%>></td>
</tr>
<tr>
<td width="50%" height="10">客户姓名:</td>
<td width="50%" height="10"><%=tcustomername%> <input type=hidden name=tname value=<%=tcustomername%>></td>
</tr>
<tr>
<td width="50%" height="12">性别:</td>
<td width="50%" height="12"><%=tcustomersex%><input type=hidden name=tsex value=<%=tcustomersex%>></td>
</tr>
<tr>
<td width="50%" height="12">联系电话:</td>
<td width="50%" height="12"><%=tcustomertel%><input type=hidden name=ttel value=<%=tcustomertel%>></td>
</tr>
<tr>
<td width="50%" height="12">E-mail:</td>
<td width="50%" height="12"><%=tcustomeremail%> <input type=hidden name=temail value=<%=tcustomeremail%>></td>
</tr>
<tr>
<td width="50%" height="12">产品型号:</td>
<td width="50%" height="12"><%=tproduct%><input type=hidden name=tproduct value=<%=tproduct%>> </td>
</tr>
<tr>
<td width="50%" height="12">定做数量:</td>
<td width="50%" height="12"><%=tproductn%><input type=hidden name=tproductn value=<%=tproductn%>></td>
</tr>
<tr>
<td width="50%" height="12">交货日期:</td>
<td width="50%" height="12"><%=tspdate%><input type=hidden name=tjhrq value=<%=tspdate%>></td>
</tr>

</table>


<p><input type="submit" value="确定" name="B3" ><input type="button" onclick="window.location.href='wsdd_cn.asp'" value="返回重写" name="B2" ></p>
</form>
</TD>
<TD width=68 height="33"> </TD>
</TR>
<TR>
<TD vAlign=top width=598 colSpan=3 height=1> </TD>
</TR>
<TR>
<TD width=180 height=143 rowSpan=3> </TD>
<TD vAlign=top width=598 colSpan=3 height=105> 
<HR SIZE=1> <FONT size=2><BR>
</FONT><FONT
size=2 ><%=byh_site_copyright%></FONT>
<P align=center><BR>
<FONT size=2><FONT
color=#ff3333>白永浩设计</FONT>制作维护&nbsp; <A
href="mailto:ssd858@126.com">ssd858@126.com</A></FONT></P></TD>
</TR>
<TR>
<TD vAlign=top width=598 colSpan=3 height=21> <HR SIZE=1> </TD>
</TR>
<TR>
<TD vAlign=top width=598 colSpan=3 height=17> <P align=center>&copy;
</P></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
</body>

2006-11-22 00:38
seal520_2008
Rank: 1
等 级:新手上路
帖 子:239
专家分:0
注 册:2006-6-13
收藏
得分:0 
你先把参数都打印出来看看是否都有,如果都有就看下字段设置的长度符合不符合

每晚0:00上线 msn:seal520_2008@ myblog:http://seal.
2006-11-22 09:44
zsf2006
Rank: 1
来 自:博客园
等 级:新手上路
威 望:1
帖 子:315
专家分:0
注 册:2006-6-3
收藏
得分:0 
把错误的代码贴出,不要把整个代码都贴出
错误的地方可能就在某一行

光临我的博客:http://
2006-11-22 18:40
快速回复:这是哪里出了问题啊?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012464 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved