1._ConnectionPtr是什么东东啊?2._RecordsetPtr是什么东东啊?3._ConnectionPtr m_pConnection; 
  _RecordsetPtr m_pRecordset;
 这样定义在头文件里可以吗?(不加任何头文件)
为什么编译时出错啊??

解决方案 »

  1.   

    使用ADO前必须在工程的stdafx.h文件里用直接引入符号#import引入ADO库文件,以使编译器能正确编译。代码如下所示: 
    //用#import引入ADO库文件 
    //---------------------------------------------------------------
     
    #import "c:\program files\common files\system\ado\msado15.dll"  
     
    no_namespaces rename("EOF" adoEOF") 
    //--------------------------------------------------------------
     
    //这行语句声明在工程中使用ADO,但不使用ADO的名字空间,并且为了避免常数冲突,常数EOF改名为adoEOF。现在不需添加另外的头文件,就可以使用ADO接口了。 
      

  2.   

    可是出现了这样的错误啊
    #error :  WINDOWS.H already included.  MFC apps must not #include <windows.h>
      

  3.   

    #import "c:\program files\common files\system\ado\msado15.dll"  
     
    no_namespaces rename("EOF" adoEOF") 放在什么位置合适呢?还是别的原因而引起的错误呢??
      

  4.   

    不是说了放在stdafx.h吗?
    你的那个错误跟这个无关的,
    错误信息不是说:“MFC apps must not #include <windows.h>”你MFC 的程序什么地方include了<windows.h>”