语句如下
    Dim company_tel As String
    company_tel = company_tel1.Text
rst.Open "select * from company where company.company_tel1 like '%" + company_tel + "%'", cnn, 1, 3

解决方案 »

  1.   

    如下更改:
        Dim company_tel As String
        company_tel = company_tel1.Text
    rst.Open "select * from company where IsNull(company.company_tel1,'') like '%" + company_tel + "%'", cnn, 1, 3
      

  2.   

    Dim company_tel As String
        company_tel = company_tel1.Text
    rst.Open "select * from company where company.company_tel1 like '%" + company_tel + "%'", cnn, 1, 3
    NULL要这样查:
    where company.company_tell is null
      

  3.   

    Dim company_tel As String
        company_tel = company_tel1.Text
    rst.Open "select * from company where company.company_tel1 like '%" + company_tel + "%' or company.company_tel1 is null", cnn, 1, 3
      

  4.   

    上面的大哥为什么? 为什么我以前用jsp的时候没有这样的情况?
      

  5.   

    为空
    company_tel1  Is null
    若为空转为空字串
    IsNull(company_tel1,'')