operation is not allow when the object is open
是什么错误
代码如下 Set rsPublishers = New ADODB.Recordset
    Set rsTitles = New ADODB.Recordset
    
    rsPublishers.Open "select * from cat", mycon, dOpenForwardOnly, adLockOptimistic    
        
    Do Until rsPublishers.EOF
       
       Set mNode = TreeView.Nodes.Add(1, tvwChild, rsPublishers!Name, CStr(rsPublishers!Name), "SClosed")
        mNode.Tag = "File"
        IntIndex = mNode.Index
        rsTitles.Open "Select * from detail", mycon, dOpenForwardOnly, adLockOptimistic  '提示错误的行数

解决方案 »

  1.   

    operation is not allow when the object is open
    是对象打开时不能执行操作
    你应该在打开第二个记录集之前关闭第一个记录集
      

  2.   

    在错误行前加
    if rsTitle.state=adstateopen then rsTitle.close
      

  3.   

    Set rsPublishers = New ADODB.Recordset
    Set rsTitles = New ADODB.Recordset
        
    if rspublishers.state=adstateopen then rspublishers.close
    rsPublishers.Open "select * from cat", mycon, dOpenForwardOnly, adLockOptimistic
      

  4.   

    if rspublishers.state=adstateopen then rspublishers.close
    rsPublishers.Open "select * from cat", mycon, dOpenForwardOnly, adLockOptimistic