有如下代码:
rs1.Open "select* from tslbb where 级别=" + Combo1.text + "and 类别编号=" + Text1(2).text + " order by 类别编号", Cnn, adOpenKeyset, adLockOptimistic
可是机器提示在“级别= 和 类别编号“中出现了操作符丢失??为什么啊??

解决方案 »

  1.   


    rs1.Open "select * from tslbb where 级别 ='" & Combo1.Text & "' and  类别编号=" & Text1(2).Text & " order by 类别编号", Cnn, adOpenKeyset, adLockOptimistic如果类别编号字段为字符字段用下式:rs1.Open "select * from tslbb where 级别 ='" & Combo1.Text & "' and  类别编号='" & Text1(2).Text & "' order by 类别编号", Cnn, adOpenKeyset, adLockOptimistic
      

  2.   

    拼凑SQL语句时,要小心缺失“'”(单引号)。
    一楼正解。