设为首页收藏本站

新微赢技术网

 找回密码
 注册
搜索
热搜: 回贴
查看: 80|回复: 1
打印 上一主题 下一主题

数据写不进数据库的问题

[复制链接]
跳转到指定楼层
1#
发表于 2010-1-16 01:01:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我的数据表byh_customer的结构是这样的: (问题是:我提交的内容除了日期跟byh_customer_id以外都写不进去..其他字段都是空的,...)请高手帮忙诊断

byh_customer_id ccompany cname csex ...................... ......填单日期
. . . . .
.
.
.
我的处理程序checkdd_cn.asp是这样的:

<%

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

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

set rs=server.createobject("adodb.recordset")
sqlstr="select byh_customer_id,ccompany,cname,csex,ctel,cemail,product,productn,交货日期,填单日期 from byh_customer"
rs.Open sqlstr,conn,3,3
rs.addnew
rs("ccompany")=tcompanyname
rs("cname")=tcustomername
rs("csex")=tcustomersex+" "
rs("ctel")=tcustomertel
rs("cemail")=tcustomeremail+" "
rs("product")=tproduct
rs("productn")=tproductn
rs("交货日期")=tspdate
rs("填单日期")=date+time
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;
2006 KERY STATIONERY CO.,LTD All right reserved. </P></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

申请友链|小黑屋|最新主题|手机版|新微赢技术网 ( 苏ICP备08020429号 )  

GMT+8, 2024-11-18 20:00 , Processed in 0.115242 second(s), 9 queries , Gzip On, Memcache On.

Powered by xuexi

© 2001-2013 HaiAn.Com.Cn Inc. 寰耽

快速回复 返回顶部 返回列表