用_RecordsetPtr时。在MISApp中定义了一个_RecordsetPtr m_pADOSet;和
bool CMISApp::ADOExecute(_RecordsetPtr &ADOSet, _variant_t &strSQL)
为什么出现了syntax error : identifier '_RecordsetPtr'错误。
error C2065: '_RecordsetPtr' : undeclared identifier
error C2065: 'ADOSet' : undeclared identifier
如何解决。
 我在stdafx.h中已引入了#import "C:\program files\common files\System\ado\msado15.dll" no_namespace \
rename("EOF","EndOfFile") \谢谢了。

解决方案 »

  1.   

    #import "C:\program files\common files\System\ado\msado15.dll" no_namespace rename("EOF","EndOfFile")要添加在stdafx.h中原有的所有的#include<...>之后
      

  2.   

    #include "afxole.h"
    ##import这段话放在你的cpp文件的前面比在stdafx当中好
      

  3.   

    不过#include "afxole.h"
    还是比较方便
      

  4.   

    bool CMISApp::ADOExecute(_RecordsetPtr &ADOSet, _variant_t &strSQL)改成
    bool CMISApp::ADOExecute(_RecordsetPtr ADOSet, _variant_t &strSQL)别用引用传递参数,这样也可以达到你的要求
      

  5.   

    谢谢大家了, 不过还是不行呀,
    其实我想问大家的是在程序里只定义_RecordsetPtr m_pADOSet;
    也出错,syntax error : identifier '_RecordsetPtr'错误
    我在stdafx.h中已引入了#import "C:\program files\common files\System\ado\msado15.dll" no_namespace rename("EOF","EndOfFile") \的前提下。哎。