form2.adodc1.RecordSource="select * from DBStudent "_
          &"where 姓名=' " & Form1.Adodc1.Recordset.Fields("姓名") & " '  "
form2.adodc1.refresh出现执行错误:
Method 'refresh' of object 'IAdodc' failed这是为什么呢?请各位高手指点迷津,谢谢!

解决方案 »

  1.   

    CommandType属性的问题,你的Adodc控件用的是查询语句,CommandType属性应该设置为1(adCmdText)
    否则就会出现你所说的错误
      

  2.   

    CommandType属性:adCmdUnknown  (RecordSource可以是查询语句、表或存储过程)  
    adCmdStoredProc  (RecordSource必须是存储过程)
    adCmdTable   (RecordSource必须是表)
    adCmdText    (RecordSource必须是查询语句)
      

  3.   

    我也有此問題。
    我的是雖然是查詢語句但我擇是adCmdUnknown 應該不會有問題吧?