用SET DATAGRID1.DATASOUCE=CMD1.EXCUTE 提示错误:the rowset is not bookable.
请大家帮帮忙。

解决方案 »

  1.   

    我在form load 事件有如下代码:
    ......
    With cmd1
    .ActiveConnection = cnn
    .CommandText = "select 状态,id,书名,借出日期 from 实验 where 实验.责任人卡号=?"
    .Prepared = False
    .CommandType = adCmdText
    .Parameters(0).Direction = adParamInput
    .Parameters(0).Type = adVarChar
    End With
    ......
    不知道哪里的毛病?
      

  2.   

    the rowset is not bookable
    行集合不能作为标签
    你执行完后CMD1.EXCUTE这个集合的RecordCount为-1解决办法:
     设置CN为客户端游标,如果记录数大于0,就没问题了
    Cnn.CursorLocation = adUseClient
      

  3.   

    Dim adoCnn As New ADODB.Connection
     Dim adoCmm As New ADODB.Command
     Dim adoRec As New ADODB.Recordset adoCnn.CursorLocation = adUseClient
     adoCnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB;Persist Security Info=False" adoCmm.ActiveConnection = adoCnn
     adoCmm.CommandType = adCmdText
     adoCmm.CommandText = "select * from employees" Set adoRec = adoCmm.Execute Set DataGrid1.DataSource = adoRec