回 帖 发 新 帖 刷新版面

主题:请教一个入门级问题

各位好,我是初学者,请各位多多关照。我的代码
<%set rs=server.CreateObject("adodb.recordset")
    if lbdm=14 then     
     sql="select * from zxml where 1gaobipei<>0 or 1gaoxp<>0"
     elseif lbdm=23  then
     sql="select * from zxml where 2wanbipei<>0 or 2wanxp<>0"
    elseif  lbdm=12 then
    sql="select * from zxml where 1chubipei<>0 or 1chuxp<>0"
    elseif  lbdm=22 then
    sql="select * from zxml where 2chubipei<>0 or 2chuxp<>0"
    elseif  lbdm=32 then
    sql="select * from zxml where 3chubipei<>0 or 3chuxp<>0"
     end if    
     %>
    
这样运行没有错误,但在后面加上另一语句后就出问题了
  <%set rs=server.CreateObject("adodb.recordset")
    if lbdm=14 then     
     sql="select * from zxml where 1gaobipei<>0 or 1gaoxp<>0"
     elseif lbdm=23  then
     sql="select * from zxml where 2wanbipei<>0 or 2wanxp<>0"
    elseif  lbdm=12 then
    sql="select * from zxml where 1chubipei<>0 or 1chuxp<>0"
    elseif  lbdm=22 then
    sql="select * from zxml where 2chubipei<>0 or 2chuxp<>0"
    elseif  lbdm=32 then
    sql="select * from zxml where 3chubipei<>0 or 3chuxp<>0"
     end if    
    [color=FF0000] rs.open sql,conn,1,1[/color]    
     %>
    
    错误类型:
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 '1gaobipei<>0 or 1gaoxp<>0' 中。
/index.asp, 第 61 行

这里的61行就是红色的这一行。请各位指教。谢谢。



[color=C0C0C0][color=FF00FF]
[size=2]------------------------以上问题解决,新问题如下--------------------------[/size][/color][/color]

 代码
    <%set rs=server.CreateObject("adodb.recordset")
   
    if lbdm=14 then     
     sql="select * from zxml2000 where yigaobipei<>0 or yigaoxp<>0"
     elseif lbdm=23  then
     sql="select * from zxml2000 where erwanbipei<>0 or erwanxp<>0"
    elseif  lbdm=12 then
    sql="select * from zxml2000 where yichubipei<>0 or yichuxp<>0"
    elseif  lbdm=22 then
    sql="select * from zxml2000 where erchubipei<>0 or erchuxp<>0"
    elseif  lbdm=32 then
    sql="select * from zxml2000 where sanchubipei<>0 or sanchuxp<>0"
    

     end if    
    [color=FF0000] rs.open sql,conn,1,1[/color]     %>
    
错误类型:
Microsoft JET Database Engine (0x80040E10)
至少一个参数没有被指定值。
/index.asp, 第 64 行

这里的64行就是红色这一行。
谢谢各位师父,请多关照。

回复列表 (共8个回复)

沙发

用数据在字段是不好的,字段是应该字母开点吧?

板凳


谢谢2楼回复,我报数字改成了字母,还是不行。

3 楼

1gaobipei<>0 or 1gaoxp<>0"其中的0是字符还是数值?

4 楼

谢谢a97191和一位叫Sword的朋友帮我解决了问题,字段名不能含数字。谢谢上述二位。

5 楼

谢谢所有看了此贴及回复此贴的所有人。我说的0是数字。

6 楼


字段名可以含数字,但字段名的第一位不能为数字!

建议详细的了解一下变量的命名规则!

7 楼

第一个问题解决了,第二个问题又来了。顶起贴子以求师父们指点。

8 楼

问题已解决,原因是我的字段名输错了。谢谢各位。

我来回复

您尚未登录,请登录后再回复。点此登录或注册