如果你用的数据库是ACCESS,你试试这样:
select * from XXX where date = #" & combo1.text & "#"

解决方案 »

  1.   

    日期型数据代入SQL中查询时两边要加# 号
      

  2.   

    dim dat
    dat=CDate(combol.text)
    select * from xxx where date='" &dat &"'
      

  3.   

    SQL Server:
    exec('select * from XXX where '+right(convert(char(10),[date]),8)+'='''+combo1.text+''')
      

  4.   

    Access就用#分隔日期
    SqlServer就用'
      

  5.   

    data change string
    or 
    string change data
      

  6.   

    直接读入变量,再代入SQL语句试试。
      

  7.   

    不要用Combo1.text,直接代入字符型变量
    dim strdata as string
    private command1_click()
        strdata=combo1.text
        select * from XXX where data="#" & strdata & "#"
    end sub
    看看行不行。