sql语句中where ..........
其后字符串要用复选框的标题来代如,谁能帮我解决以下?

解决方案 »

  1.   

    where check1.value=1
    控件-0 是没有检查(缺省值),1 为已检查,和 2 为变灰(变暗)。
      

  2.   

    在按确定按钮的事件里打判断的代码If Check1.Value = 1 Then 
      Str = Check1.Caption
      sqlStr = "select * from tbl where " + str + "='" + Text1.Text + "'"
    End If
      

  3.   

    选择一个查询条件的话,为什么不能用 "select * from table where str=check1.caption"
    如果我是多个查询条件,必须用 "select * from table where str1=check1.caption and str2=check2.caption and ...."
      

  4.   

    to dylan0428:
     这样的话,不知那一个被选择了,所以你应有一个判断选择的语句,可用if语句,逐个判断。
      

  5.   

    判断当然必须了,我用以下方法解决了
    str = str + " and" & " " & "规划办理情况=-1" 
    然后把字符串前面的 " and" & " " 用mid(6,i,1)去掉了,不知是不是常用的方法.