标题:一个ID超级链接的修改字段问题
只看楼主
jdcdds2004
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-11-3
结帖率:0
已结贴  问题点数:0 回复次数:2 
一个ID超级链接的修改字段问题
在CX1。asp至cx2.asp过程中出现 语法错误 (操作符丢失) 在查询表达式 'id=' 中。

cx.asp主要代码:
<td width="3%"><p align="center"><a href="cx1.asp?id=<%=rs("id")%>" target="_blank"><%=rs("id")%></a></td>
cx1.asp代码:
<!--#include file="conn.asp"-->
<%
id=request("id")
set rs=server.createobject("adodb.recordset")'创建记录集对象
exec="SELECT * FROM clwx WHERE id="&id&""
rs.open exec,conn,3,3
%>
<form name="form1" method="post" action="cx2.asp">
<p align="center"><b>
<font face="楷体_GB2312">
<font size="5" color="#0080C0">焦场设备档案</font><font size="5" color="#0000FF">[修
改]</font></font></p>
<table border="1" width="695" height="755" cellspacing="1" bordercolor="#757575" cellpadding="0" style="border-collapse: collapse" id="table1">
    <tr>
        <td height="19" width="82" align="center" bgcolor="#C0C0C0"><b>ID</b></td>
        <td height="19" width="105" align="center" bgcolor="#C0C0C0"><b>配件名称</b></td>
        <td height="19" width="109" align="center" bgcolor="#C0C0C0"><b>车辆名称</b></td>
        <td height="19" width="155" align="center" bgcolor="#C0C0C0"><b>配件型号</b></td>
        <td height="19" width="100" align="center" bgcolor="#C0C0C0"><b>供应商</b></td>
        <td height="19" width="120" align="center" bgcolor="#C0C0C0">
        <b>经手人</b></td>
    </tr>
    <tr>
        <td height="32" width="82" align="center"><%=rs("id")%></td>
        <td height="32" width="105" align="center">
        <input type="text" name="pjmc" size="12" value="<%=rs("pjmc")%>"></td>
        <td height="32" width="109" align="center">
        <input type="text" name="clmc" size="12" value="<%=rs("clmc")%>"></td>
        <td height="32" width="155" align="center">
        <input type="text" name="pjxh" size="15" value="<%=rs("pjxh")%>"></td>
        <td height="32" width="100" align="center">
        <input type="text" name="gys" size="12" value="<%=rs("gys")%>"></td>
        <td height="32" width="120" align="center"><b>
        <input type="text" name="jsr" size="12" value="<%=rs("jsr")%>"></b></td>
    </tr>
    <tr>
        <td height="19" width="82" align="center" bgcolor="#CDCDCD" bordercolor="#A1A1A1">
        <b>维修类型</b></td>
        <td height="19" width="105" align="center" bgcolor="#CDCDCD" bordercolor="#A1A1A1">
        <b>配件种类</b></td>
        <td height="19" width="109" align="center" bgcolor="#CDCDCD" bordercolor="#A1A1A1">
        <b>投用日期</b></td>
        <td height="19" width="155" align="center" bgcolor="#CDCDCD" bordercolor="#A1A1A1">
        <b>维修日期</b></td>
        <td height="19" width="100" align="center" bgcolor="#CDCDCD" bordercolor="#A1A1A1">
        <font size="2"><b>数量</b></font></td>
        <td height="19" width="120" align="center" bgcolor="#CDCDCD" bordercolor="#A1A1A1">
        <b>单价</b></td>
    </tr>
    <tr>
        <td height="32" width="82" align="center">
        <input type="text" name="wxlx" size="8" value="<%=rs("wxlx")%>"></td>
        <td height="32" width="105" align="center">
        <input type="text" name="pjzl" size="12" value="<%=rs("pjzl")%>"></td>
        <td height="32" width="109" align="center">
        <input type="text" name="tyrq" size="12" value="<%=rs("tyrq")%>"></td>
        <td height="32" width="155" align="center">
        <input type="text" name="wxrq" size="15" value="<%=rs("wxrq")%>"></td>
        <td height="32" width="100" align="center">
        <input type="text" name="sl" size="12" value="<%=rs("sl")%>"></td>
        <input type="hidden" name="xgrq" value="<%=now()%>">
        <td height="32" width="120" align="center"><%=rs("tjrq")%><input type="text" name="dj" size="12" value="<%=rs("dj")%>"></td>
    </tr>
    <tr>
        <td height="19" width="296" align="center" bgcolor="#CDCDCD" colspan="3">
        <b>合计价格</b></td>
        <td height="19" width="375" align="center" bgcolor="#CDCDCD" colspan="3">
        <b>调度落实</b></td>
    </tr>
    <tr>
        <td height="30" width="296" align="center" colspan="3">
        <b>
        <input type="text" name="hjjg" size="12" value="<%=rs("hjjg")%>"></td>
        <td height="30" width="375" align="center" colspan="3">
        <b>
        <input type="text" name="ddls" size="12" value="<%=rs("ddls")%>"></td>
    </tr>
    <tr>
        <td height="19" width="305" colspan="3" bgcolor="#CDCDCD">
        <p align="center"><b>维修记录</b></td>
        <td height="19" width="381" colspan="3" bgcolor="#CDCDCD">
        <p align="center"><b>故障描述</b></td>
    </tr>
    <tr>
        <td height="373" width="305" colspan="3" align="left" valign="top">
        <textarea rows="28" name="wxjl" cols="41"><%=rs("wxjl")%></textarea></td>
        <td height="373" width="381" colspan="3" align="left" valign="top">
        <textarea rows="28" name="gzms" cols="51"><%=rs("gzms")%></textarea></td>
    </tr>
    </table>

        <p align="center"> 
        
<input type="submit" name="Submit" value="提交">
<input type="hidden" name="id" value="<%=request.form("id")%>">
</form>
        </td>
    </tr>

<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>


 
cx2.asp
<!--#include file="conn.asp"-->
<%
exec="select * from clwx where id="&request.form("id")
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
rs("pjmc")=request.form("pjmc")
rs("clmc")=request.form("clmc")
rs("pjxh")=request.form("pjxh")
rs("jsr")=request.form("jsr")
rs("tyrq")=request.form("tyrq")
rs("wxrq")=request.form("wxrq")
rs("wxlx")=request.form("wxlx")
rs("gys")=request.form("gys")
rs("dj")=request.form("dj")
rs("sl")=request.form("sl")
rs("hjjg")=request.form("hjjg")
rs("gzms")=request.form("gzms")
rs("wxjl")=request.form("wxjl")
rs("ddls")=request.form("ddls")
rs("pjzl")=request.form("pjzl")
rs.update
Response.write"修改成功"
rs.close
set rs=nothing
conn.close
set conn=nothing
%>


 
搜索更多相关主题的帖子: 记录 blank request include 
2011-11-03 08:09
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:10 
在CX1。asp至cx2.asp过程中出现 语法错误 (操作符丢失) 在查询表达式 'id=' 中。
记住出现这种错误,立刻检查提交页面的代码是否提交过来数据了
2011-11-03 13:52
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
得分:10 
<input type="submit" name="Submit" value="提交">
<input type="hidden" name="id" value="<%=id%>">

QQ:63572063
2011-11-03 18:39



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-354127-1-1.html




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

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