注册 登录
编程论坛 ASP技术论坛

写入数据库错误,求救

xfwxy2008 发布于 2008-04-25 16:01, 944 次点击
一 数据库连接是没错的,我其它的功能也是调用这个连接是正确的!
二 此内容已经是完全的了,其它正常的我没搞出来
三 第一结,数据连接,第二结,数据表单写入,第三结,数据定入数据库,就这个有错,写入失败!
四 这是一个完全过程,请帮看看

数据连接 conn.asp
<%
dim conn,connstr
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../mdbsjdate/%#d.asa")
Set Conn = Server.CreateObject("ADODB.Connection")
conn.open connstr
%>

表单写入页内容  SDCZ.asp

<!--#include file="conn.asp"-->
<%
v_custom2=replace(trim(request("id")),"'","''")
set rs=server.createobject("adodb.recordset")
sql="SELECT * FROM server where id="&v_custom2
rs.open sql,conn,1,1
%>
<div align="center">
<form method="POST" action="save2.asp" name="form1" >
<table border="1" width="537" height="161" bordercolorlight="#C0C0C0" bordercolordark="#C0C0C0">
<tr>
<td height="28" width="103">充值服务器</td>
<td height="28" width="414">
<input type="text" name="fwid" size="4" maxlength="15" value="<%=rs("id")%>" id="fwid">
<input type="text" name="fwm" size="14" maxlength="15" value="<%=rs("name")%>" id="fwm"><font color="#FF0000">*目前为玩家充值的服务器</font></td>
</tr>
<tr>
<td height="7" width="103">充值账号</td>
<td height="7" width="414">
<input type="text" name="czid" size="15" maxlength="15" id="czid"><font color="#FF0000"> *当时为玩家充值的账号</font></td>
</tr>
<tr>
<td height="6" width="103"><font size="2">发放数量</font></td>
<td height="6" width="414">
<input type="text" name="czsl" size="6" maxlength="5" id="dzsl"><font color="#FF0000" size="2">
*给完家的创信币数量! </font>
</td>
</tr>
<tr>
<td height="27" width="103"> </td>
<td height="27" width="414">
<p>                  
<input type="submit" value="确 定" name="B5" >  </p>
</form>

数据写入页内容 save2.asp

<!--#include file="conn.asp"-->

<%
fwid=replace(trim(request("fwid")),"'","''")
fwm=replace(trim(request("fwm")),"'","''")
czid=replace(trim(request("czid")),"'","''")
czsl=replace(trim(request("czsl")),"'","''")
if czid="" then
response.Write "<Script>alert('请填写充值玩家的账号!');javascript:history.go(-1)</Script>"
Response.end
end if
if czsl="" then
response.Write "<Script>alert('请填写要发放的数量!');javascript:history.go(-1)</Script>"
Response.end
set rs=server.createobject("adodb.recordset")
sql="SELECT * FROM 正式订单表"
rs.open sql,conn,1,3
rs.addnew
rs("商户订单号")=now()
rs("支付途径中文")="手动充值"
rs("贺喜定单号")=now()
rs("冲值人物名称")=czid
rs("冲值服务器名")=fwm
rs("支付金额")=czsl
rs("元宝数量")=czsl
rs("定单状态")="0"
rs("时间")=now()
rs("服务器ID")=fwid
rs.update
rs.close
response.Write "<Script>location.href ='sdcz2.asp'</Script>"
response.end
end if

%>

新手!!不知道那错了,求大师指点!!
新手!!不知道那错了,求大师指点!!

附全文件高手帮看!

[[it] 本帖最后由 xfwxy2008 于 2008-4-25 16:46 编辑 [/it]]
13 回复
#2
madpbpl2008-04-25 16:10
把数据库中文字段改成英文字段试试
#3
dhdhzzw2008-04-25 16:12
什么错误,你说清楚啊,不然怎么解决。
#4
xfwxy20082008-04-25 16:17
不能写入
写入数据不成功,提交表单提示不写入数据库
#5
xfwxy20082008-04-25 16:20
在线等答案,求高手帮忙!!
#6
dhdhzzw2008-04-25 16:22
1。如果没有返回错误的话,看看数据库权限设置
2。在数据库搜索处   response.write 看看执行到哪一步,。。
#7
xfwxy20082008-04-25 16:24
权限可以写入,其它数据写入正常,删除,也正常
#8
xfwxy20082008-04-25 16:26
fwid=replace(trim(request("fwid")),"'","''")
fwm=replace(trim(request("fwm")),"'","''")
czid=replace(trim(request("czid")),"'","''")
czsl=replace(trim(request("czsl")),"'","''")
if czid="" then
response.Write "<Script>alert('请填写充值玩家的账号!');javascript:history.go(-1)</Script>"
Response.end
end if
if czsl="" then
response.Write "<Script>alert('请填写要发放的数量!');javascript:history.go(-1)</Script>"
Response.end
到此处都正常,其它的就不知道那错了,知道就不会在这着急了!!看过N次没发现问题
#9
dhdhzzw2008-04-25 16:28
rs("商户订单号")=now()
rs("支付途径中文")="手动充值"
rs("贺喜定单号")=now()
rs("冲值人物名称")=czid
rs("冲值服务器名")=fwm
rs("支付金额")=czsl
rs("元宝数量")=czsl

rs("定单状态")="0"
rs("时间")=now()
rs("服务器ID")=fwid
你确保上面的没错么?
#10
xfwxy20082008-04-25 16:29
我发个完全的网站上来你看看吧
#11
xfwxy20082008-04-25 16:34
http://IP.
帮我下载去看看这个里面,所要的文件都在,就是不行,其它的正常
主要是 SDCZ.ASP  SDCZ2.ASP  save2.asp  这三个文
#12
lili06109312008-04-25 16:41
最好在数据库里不要用中文,不然会很容易出错的
#13
xfwxy20082008-04-25 16:44
但为什么其它里都正常呢!!
#14
hmhz2008-04-25 21:48
中文的不是不行,而是不稳定,要不然怎么说容易出错呢,毕竟这些东西都是老外开发的,所以存在字体兼容性问题
1