ADO2类在VS2013中编译出错(WIN7)

qq_34470481 2016-06-12 11:59:51

//
// MODULE: Ado2.h
//
// AUTHOR: Carlos Antollini <cantollini@hotmail.com>
//
// Copyright (c) 2001-2004. All Rights Reserved.
//
// Date: August 01, 2005
//
// Version 2.20
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is
// not sold for profit without the authors written consent, and
// providing that this notice and the authors name and all copyright
// notices remains intact.
//
// An email letting me know how you are using it would be nice as well.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability for any damage/loss of business that
// this product may cause.
//
//
//////////////////////////////////////////////////////////////////////


#if !defined(AFX_ADO2_H_INCLUDED_)
#define AFX_ADO2_H_INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <afx.h>
#include <afxdisp.h>
#include <math.h>

#pragma warning (disable: 4146)
// CG : In order to use this code against a different version of ADO, the appropriate
// ADO library needs to be used in the #import statement
#pragma message ("Make sure you go to Tools.Options.Directories.Library files and add the paths to msado15.dll and msjro.dll will usually be in C:\\Program Files\\Common Files\\System\\ado")
//#import "C:\Program Files\Common Files\System\ado\msado15.dll" rename("EOF", "EndOfFile")
//#import "C:\Program Files\Common Files\System\ado\MSJRO.DLL" no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")


//原始默认
//#import <msado15.dll> rename("EOF", "EndOfFile")
//#import <ADO/MSJRO.DLL> no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")
//

//指定目录 为了兼容win7编译出的在xp下也能连接 将xp ado拷贝到工程目录下ADO文件夹
#import "./ADO/msado15.dll" rename("EOF", "EndOfFile")
#import "./ADO/MSJRO.DLL" no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")

using namespace ADODB;
...
...
...

编译直接出错

错误 2 error C2039: “_Recordset_DeprecatedPtr”: 不是“ADODB”的成员 f:\test\release\msjro.tlh 195 1 test
错误 3 error C2146: 语法错误: 缺少“;”(在标识符“ConflictTables”的前面) f:\test\release\msjro.tlh 195 1 test
错误 4 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int f:\test\release\msjro.tlh 195 1 test
错误 5 error C2039: “_Recordset_DeprecatedPtr”: 不是“ADODB”的成员 f:\test\release\msjro.tlh 223 1 test
。。。
。。。
。。。
错误 102.。。。。。


这个ADO2类有人在VS中跑成功过么?
...全文
1076 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
junliucq 2019-03-09
  • 打赏
  • 举报
回复
你好,我现在把工程从vs2010升级到2017,也在编译ado2.h这个东西,一直报错,错误同样,求指点一下
rain_hello 2017-04-24
  • 打赏
  • 举报
回复
你好,我现在也在编译ado2.h这个东西,一直报错,求指点一下
jasonabc1 2016-07-10
  • 打赏
  • 举报
回复
缺少 h 文件, afxdb.h. 还有一个 COMMCLT 的 h, 不记得叫什么了 . afxcontrolbars.h 好象是它吧, 反正是一个看名称完全无关, 但是是个控件基础的h
qq_34470481 2016-06-12
  • 打赏
  • 举报
回复

//
//  MODULE: Ado2.h
//
//	AUTHOR: Carlos Antollini 
//
//  mailto: cantollini@hotmail.com
//
//	Date: 07/02/2003
//
//	Version 2.10
// 

#if !defined(AFX_ADO2_H_INCLUDED_)
#define AFX_ADO2_H_INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <afx.h>
#include <afxdisp.h>
#include <math.h>
//#include "C:\Program Files\Microsoft Analysis Services\Samples\Include\msmd.h"

#pragma warning (disable: 4146)
// CG : In order to use this code against a different version of ADO, the appropriate
// ADO library needs to be used in the #import statement

//可以编译通过
//#import "C:\Program Files\Common Files\System\ADO\msado15.dll" rename("EOF", "EndOfFile")
//#import "C:\Program Files\Common Files\System\ado\MSJRO.DLL" no_namespace


//不可以编译通过   why?
#import "./ADO/msado15.dll" rename("EOF", "EndOfFile")
#import "./ADO/MSJRO.DLL" no_namespace


using namespace ADODB;

qq_34470481 2016-06-12
  • 打赏
  • 举报
回复
高手 版主 们都去哪了。。。

4,011

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧