属性的使用无效  我在ADO连接SQL返回记录集时
编译错误:属性的使用无效 系统提示,不知道 该如何解决
'SQL:sql查询语言,
'返回记录集

解决方案 »

  1.   

    象这样:工程--->引用--->Microsoft ActiveX Data Object 2.x(版本号)    Dim CN   As New ADODB.Connection                '定义数据库的连接
        Dim Rs   As New ADODB.Recordset    CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\NWIND.MDB;Persist Security Info=False"
        CN.Open    Rs.CursorLocation = adUseClient
        Rs.Open "select * from employees", CN, adOpenDynamic, adLockBatchOptimistic    Set DataGrid1.DataSource = Rs