Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= DB1.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from Table1 where TE= '你好'"

解决方案 »

  1.   

    Adodc1.recordset.open = "select * from Table1 where TE= '%你好%'"
    set datagrid.datasource=adodc1.recordset
      

  2.   

    请问:"select * from Table1 where TE= '%你好%'"里面的TE是什么意思呢???
      

  3.   

    字段名。建议你看看sql的书。
      

  4.   

    上面两位用了 Adodc1.RecordSource 和 Adodc1.recordset.open 怎么第一个没有反映,第二个提示.Open缺少函数或变量??????????
      

  5.   

    楼上的各位,我也同样遇到了这个问题,代码如下:
    Private Sub Text1_KeyDown(…………)
      if KeyCode = vbKeyReturn Then
         Call Search
      end if
    End Sub
    Private Sub Search()
      Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;
                                Data Source= DB1.mdb;Persist Security
                                Info=False"
      Adodc1.RecordSource = "select * from Table1 where 字段名 = " + _
                            定义的一个由用户输入的Text1.text赋值的变量
    End Sub
    运行该程序,不会出错,但也不会实现查询,这是为什么?