Dim rsValue As ADODB.Recordset<这里是 rsValue.open的代码>
FG是一个FlexGrid控件Set FG.DataSource = rsValue为什么在Set FG.DataSource = rsValue的时候会有错?
'Error 91 - Object Variable Or With Block Variable Not Set' 

解决方案 »

  1.   

    Dim rsValue As new ADODB.Recordset
      

  2.   

    '你没贴出关键代码Dim rsValue As new ADODB.Recordset
    if rsvalue.state=adstateopen then rsvalue.close
    rsvalue.open " select * from tablename ",conn,adopenkeyset,adlockreadonly
    Set FG.DataSource = rsValue
    set rsvalue=nothing
      

  3.   

    Dim rsValue As ADODB.Recordset
    set rsValue=new ADODB.Recordset
    你没有NEW rsValue对象,怎么取的数据啊?
      

  4.   


    变量或with块变量未设置?
    1、rsValue.CursorLocation = adUseClient
    2、检查语法有无错误,如缺少end with、end if
      

  5.   

    我rsValue已经成功的打开的,而且也可以读出里面的数据,可就是 
    Set FG.DataSource = rsValue
    的时候出错
    rsValue.CursorLocation = adUseClient
    这个我也试过的,还是不行
      

  6.   

    你是不是用错了控件?
    MSFlexGrid是和data控件绑定的
    如果用MSFlexGrid和ADO绑定的话,就会出现你所碰到的错误而MSHFlexGrid是和ADO绑定的