超级难题!ADO连接Excel出错!!求大虾帮助(▔/﹏\▔)

enzo82 2012-03-17 01:21:59
正在做一个管理系统。数据库是oracle。希望能连接Excel做报表。
但是一导入excel.exe就出错。

在stdafx.h里有#import "c:\program Files\Common Files\system\ado\msado15.dll" no_namespace rename("EOF","adoEOF") rename("BOF","adoBOF")



D:\我的文档\Desktop\项目\checking\excel.h(7881) : warning C4099: 'Parameter' : type name first seen using 'struct' now seen using 'class'
d:\我的文档\desktop\checking\release\msado15.tlh(97) : see declaration of 'Parameter'
D:\我的文档\Desktop\项目\checking\excel.h(7911) : error C2011: 'Parameters' : 'struct' type redefinition
D:\我的文档\Desktop\项目\checking\excel.h(10596) : error C2011: 'Errors' : 'struct' type redefinition
D:\我的文档\Desktop\项目\checking\excel.h(10617) : error C2011: 'Error' : 'struct' type redefinition
D:\我的文档\Desktop\项目\checking\excel.cpp(43000) : error C2039: 'GetApplication' : is not a member of 'Parameters'
d:\我的文档\desktop\checking\release\msado15.tlh(2035) : see declaration of 'Parameters'
D:\我的文档\Desktop\项目\checking\excel.cpp(43003) : error C2065: 'InvokeHelper' : undeclared identifier
D:\我的文档\Desktop\项目\checking\excel.cpp(43007) : error C2039: 'GetCreator' : is not a member of 'Parameters'
d:\我的文档\desktop\checking\release\msado15.tlh(2035) : see declaration of 'Parameters'
D:\我的文档\Desktop\项目\checking\excel.cpp(43014) : error C2039: 'GetParent' : is not a member of 'Parameters'
d:\我的文档\desktop\checking\release\msado15.tlh(2035) : see declaration of 'Parameters'
D:\我的文档\Desktop\项目\checking\excel.cpp(43021) : error C2039: 'Add' : is not a member of 'Parameters'
d:\我的文档\desktop\checking\release\msado15.tlh(2035) : see declaration of 'Parameters'
D:\我的文档\Desktop\项目\checking\excel.cpp(43032) : error C2509: 'GetCount' : member function not declared in 'Parameters'
d:\我的文档\desktop\checking\release\msado15.tlh(2035) : see declaration of 'Parameters'
D:\我的文档\Desktop\项目\checking\excel.cpp(43039) : error C2063: 'Item' : not a function
D:\我的文档\Desktop\项目\checking\excel.cpp(43039) : error C2040: 'Item' : 'struct IDispatch *(const struct tagVARIANT &)' differs in levels of indirection from 'class _com_ptr_t<class _com_IIID<struct _Parameter,&struct __s_GUID _GUID_0000050c_0000
_0010_8000_00aa006d2ea4> >'
D:\我的文档\Desktop\项目\checking\excel.cpp(43039) : fatal error C1903: unable to recover from previous error(s); stopping compilation
执行 cl.exe 时出错.

checking.exe - 1 error(s), 0 warning(s)
...全文
115 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
enzo82 2012-03-17
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 xianglitian 的回复:]

我贴的连接你看了么
[/Quote]

是不需要加入所有的类只需要特定的几个吗?
enzo82 2012-03-17
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 xianglitian 的回复:]

我贴的连接你看了么
[/Quote]

看了。还报出那些错。
向立天 2012-03-17
  • 打赏
  • 举报
回复
我贴的连接你看了么
enzo82 2012-03-17
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 xianglitian 的回复:]

操作excel不要用ado
用com的方式
http://blog.sina.com.cn/s/blog_4504388f0100073f.html
[/Quote]

有关于如何用com方式操作的例子吗?
向立天 2012-03-17
  • 打赏
  • 举报
回复
操作excel不要用ado
用com的方式
http://blog.sina.com.cn/s/blog_4504388f0100073f.html

4,011

社区成员

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

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