标题:这个sql语句怎么运行不了。
取消只看楼主
xinzhi9090
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2010-4-1
结帖率:0
已结贴  问题点数:20 回复次数:1 
这个sql语句怎么运行不了。
<!--#include file="conn.asp"-->
<%
    Set rs = server.CreateObject("adodb.recordset")
    sql = "select * from b "
    rs.Open sql, conn, 1, 3
    do while not rs.eof
    zhuye=rs("zhuye")
    dianhua=rs("dh")
    Set rs1 = server.CreateObject("adodb.recordset")
    sql1="select * from a where dh='"&rs("dh") and zhuye="" &"'"
    rs1.Open sql1, conn, 1, 3
    do while not rs1.eof
    rs1("zhuye") = zhuye
    rs1.update
    rs1.movenext
loop
rs1.close
    rs.movenext
loop
rs.close
set rs=nothing

response.write "更新完毕"  
   
    %>


原先这句是可以正常运行的:sql1="select * from a where dh='"&rs("dh") &"'"

后面加个判断语句,要是 zhuye字段为空,才更新 : sql1="select * from a where dh='"&rs("dh") and zhuye="" &"'"

但是这个语句有问题:Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: '[string: "select * from a wher"]'
/albb/albb.asp, 第 10 行


到底该怎么写呢。。。。。请教下大家


先~谢谢~了~~
搜索更多相关主题的帖子: sql 语句 运行 
2010-07-17 12:57
xinzhi9090
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2010-4-1
得分:0 
顶~~
2010-07-17 16:09



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




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

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