我使用Data控件和DataGrid控件显示access数据库内容
在stdafx.h中:
#include <icrsint.h>
#define INITGUID
#import "msado15.dll" rename_namespace("ADOCG") rename("EOF","EndOfFile")
在App中
AfxOleInit();
CoInitialize(NULL);

_ConnectionPtr pConn;编译提示:'_ConnectionPtr' : undeclared identifier

解决方案 »

  1.   

    #import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
       no_namespace rename("EOF", "EndOfFile")
    我一般这样用
      

  2.   

    #import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
       no_namespace rename("EOF", "EndOfFile")
    我一般这样用
      

  3.   

    这样用#import "C:\Program Files\Common Files\System\ADO\Msado15.dll" \
    no_namespace \
    rename("EOF","ADOEnd")
    这样
    #import "msado15.dll" rename_namespace("ADOCG") rename("EOF","EndOfFile")用的话你必须把msado15.dll拷到你运行的目录下或
    system32下