报如下错误:
program files\microsoft visual studio\myprojects\database\debug\msado15.tlh(409) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
c:\program files\microsoft visual studio\myprojects\database\debug\msado15.tlh(1317) : error C2629: unexpected 'short ('
c:\program files\microsoft visual studio\myprojects\database\debug\msado15.tlh(1317) : error C2238: unexpected token(s) preceding ';'
c:\program files\microsoft visual studio\myprojects\database\stdafx.h(33) : error C2146: syntax error : missing ';' before identifier 'rename'
c:\program files\microsoft visual studio\myprojects\database\stdafx.h(33) : error C2501: 'no_namespace' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\database\stdafx.h(33) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

解决方案 »

  1.   

    #import "c:\program files\common files\system\ado\msado15.tlb" 
      

  2.   

    c:\program files\microsoft visual studio\myprojects\database\stdafx.h(33) : fatal error C1083: Cannot open type library file: 'c:\program files\common files\system\ado\msado15.tlb': No such file or directory
      

  3.   

    warning C4146,用#pragma warning (disable:4146)可以忽略,这个不用管他,正常现象
    第二个是什么错你得把tlh这一行贴上来才知道,
    这一句话本身是没有错的,建议你重庄以下madc_tye.exe把
      

  4.   

    你看看你那个地方有没有那个文件另外
    “#import "c:\program files\common files\system\ado\msado15.dll" 
    no_namespace rename("EOF","adoEOF")”
    不能换行!
      

  5.   

    to  ljxfs(肥仔)
    按照你的办法“#import "c:\program files\common files\system\ado\msado15.dll" 
    no_namespace rename("EOF","adoEOF")”
    没有换行,仍旧报错:
    c:\program files\microsoft visual studio\myprojects\database\debug\msado15.tlh(171) : error C2011: 'LockTypeEnum' : 'enum' type redefinition
    c:\program files\microsoft visual studio\myprojects\database\debug\msado15.tlh(214) : error C2011: 'DataTypeEnum' : 'enum' type redefinition
    c:\program files\microsoft visual studio\myprojects\database\debug\msado15.tlh(258) : error C2011: 'FieldAttributeEnum' : 'enum' type redefinition
    c:\program files\microsoft visual studio\myprojects\database\debug\msado15.tlh(279) : error C2011: 'EditModeEnum' : 'enum' type redefinition
    c:\program files\microsoft visual studio\myprojects\database\debug\msado15.tlh(287) : error C2011: 'RecordStatusEnum' : 'enum' type redefinition
    c:\program files\microsoft visual studio\myprojects\database\debug\msado15.tlh(407) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
    c:\program files\microsoft visual studio\myprojects\database\debug\msado15.tlh(530) : error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition
      

  6.   

    看你的msado15.dll是不是在制定的文件夹内,然后按以下方式写
    #import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF","adoEOF")
    good luck!
      

  7.   

    #import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename ("EOF","adoEOF")
    #import "C:\PROGRAM FILES\COMMON FILES\System\ado\MSJRO.DLL" no_namespace  
      

  8.   

    #define INITGUID
    #import "c:\program files\common files\system\ado\msado15.dll" rename_namespace("ADOCG") rename("EOS", "adoEOS") rename("EOF", "adoEOF")
    using namespace ADOCG;
    #include "icrsint.h"
    这样试试