Data1.RecordSource = dbtn & Space(1) & Where & Form17.Combo1.Text &_ Form17.Combo2.Text & Form17.Text1.Text & ";"

解决方案 »

  1.   

    Data1.RecordSource = dbtn & Space(1) & "Where " & Form17.Combo1.Text &_ Form17.Combo2.Text & Form17.Text1.Text & ";" 
      

  2.   

     to:hnlzh(吸海垂虹)
    你的说法是错的,我试过了 
      

  3.   

    妳把妳的字串debug.print dbtn & Space(1) & Where & Form17.Combo1.Text &_ Form17.Combo2.Text & Form17.Text1.Text & ";" 出來看看
      

  4.   

    select * from hzl  Where ;
    这是打出来的结果
      

  5.   

    有这么写的吗。
    错误为:1。where 应加双引号。 2。&_  应为 & _ ;其中却空格。
      

  6.   

     to:lanren_me(阿波)
     你说的方法我试过没有用呀
      

  7.   

    & iif((trim(Form17.Combo1.Text &_ Form17.Combo2.Text & Form17.Text1.Text))="","", "Where " & Form17.Combo1.Text &_ Form17.Combo2.Text & Form17.Text1.Text)   
    妳試試看,我這可以通過
      

  8.   

    swhere = "(" & Combo1.Text & Combo2.Text & Text1.Text & ")"
    dbtn = "select * from hzl where"
    ssql = dbtn & Space(1) & swhere
    Data1.RecordSource = ssql & ";"
    我在立即窗口看到的结果是:select * from hzl where  (医院编号=001);结果是对的呀,可以系统报错,"标准表达式中数据类型不匹配"
      

  9.   

    妳用sqlservser還是access?
    用sqlservr寫3成 医院编号='001'
    access          医院编号=001 
      

  10.   

    swhere = "(" & Combo1.Text & Combo2.Text & Text1.Text & ")"
    dbtn = "select * from hzl where"
    ssql = dbtn & Space(1) & swhere
    Data1.RecordSource = ssql & ";"
    我在立即窗口看到的结果是:select * from hzl where  (医院编号=001);结果是对的呀,可以系统报错,"标准表达式中数据类型不匹配"没有人能解决吗???
      

  11.   

    to hnlzh(吸海垂虹) 
    看看我下面一个问题吧