| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 910 人关注过本帖
标题:写入数据库失败,求救
只看楼主 加入收藏
xfwxy2008
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2008-4-25
收藏
 问题点数:0 回复次数:0 
写入数据库失败,求救
一 数据库连接是没错的,我其它的功能也是调用这个连接是正确的!
二 此内容已经是完全的了,其它正常的我没搞出来
三 第一结,数据连接,第二结,数据表单写入,第三结,数据定入数据库,就这个有错,写入失败!
四 这是一个完全过程,请帮看看
带附件,能解决可以加QQ
数据连接 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:43 编辑 [/it]]

wt.rar (147.16 KB)
搜索更多相关主题的帖子: 数据库 Microsoft conn 
2008-04-25 16:03
快速回复:写入数据库失败,求救
数据加载中...
 
   



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

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