首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

class does not support automation or does not support expected interface 錯誤解决方法

2012-06-20 
class does not support automation or does not support expected interface 錯誤If bPAccess ThenstrSQL

class does not support automation or does not support expected interface 錯誤
If bPAccess Then
  strSQL = "select appr_status,BATCH_NO,REF_NO,ITEM_NO,ITEM_DESCE,oms_itemno,ITEM_GRP,MODEL_NO,CUST_PN, REV, " & _
  "MANU_NAME,MANU_PN,PROCUR,SPEC_PROCU,UOM,NET_W,NET_UNIT,CUST_CODE,Safe_Mat,mold_code, " & _
  "material_type,factory_code,item1,item2,item3,item4,item5,item6,item7,item8 ,i_date,by_user,export_fg, conrohs = case itemmstr.rohs when 1 then 'ROHSR0' when 2 then 'ROHSR1' when 3 then 'ROHSR2' when 4 then 'ROHSRE' else '' end,suggest_itemno,batchmgt from itemmstr where rtrim(ltrim(appr_status))='P' order by ref_no"

  Else
  strSQL = "select appr_status,BATCH_NO,REF_NO,ITEM_NO,ITEM_DESCE,oms_itemno,ITEM_GRP,MODEL_NO,CUST_PN, REV, " & _
  "MANU_NAME,MANU_PN,PROCUR,SPEC_PROCU,UOM,NET_W,NET_UNIT,CUST_CODE,Safe_Mat,mold_code, " & _
  "material_type,factory_code,item1,item2,item3,item4,item5,item6,item7,item8 ,i_date,by_user,export_fg, conrohs = case itemmstr.rohs when 1 then 'ROHSR0' when 2 then 'ROHSR1' when 3 then 'ROHSR2' when 4 then 'ROHSRE' else '' end,suggest_itemno,batchmgt from itemmstr where left(batch_no, " & i & ")='" & strPUser & "' and rtrim(ltrim(appr_status)) <> 'A' order by ref_no ,item_no "

  End If


  rs.Open strSQL, cn, adOpenStatic, adLockReadOnly
  
  Set DBGrid1.DataSource = rs


运行时提示 Set DBGrid1.DataSource = rs 出现标题错误!
了解的棒棒忙谢谢!!!



[解决办法]

DBGrid 不支持 ADO,换 DataGrid 就好。

或者换用 DAO 的 recordset.

热点排行