📄 subject_62671.htm
字号:
<p>
序号:62671 发表者:walter0505 发表日期:2003-11-28 08:40:05
<br>主题:一个数据库连接问题?
<br>内容:在一个已经做好的工程中,我想把数据库加进去,于是我增加了一个新类(emplist.cpp),其基类为CDaoRecordset.可是当我运行时却出现如下错误:<BR>:\vc\projects\myreport4\emplist.h(14) : error C2504: 'CDaoRecordset' : base class undefined<BR>e:\vc\projects\myreport4\emplist.h(16) : error C2629: unexpected 'class CEmpList ('<BR>e:\vc\projects\myreport4\emplist.h(16) : error C2238: unexpected token(s) preceding ';'<BR>e:\vc\projects\myreport4\emplist.h(34) : error C2061: syntax error : identifier 'CDaoFieldExchange'<BR>E:\vc\projects\MyReport4\EmpList.cpp(17) : error C2653: 'CDaoRecordset' : is not a class or namespace name<BR>E:\vc\projects\MyReport4\EmpList.cpp(17) : error C2065: 'classCDaoRecordset' : undeclared identifier<BR>E:\vc\projects\MyReport4\EmpList.cpp(19) : error C2065: 'CDaoDatabase' : undeclared identifier<BR>E:\vc\projects\MyReport4\EmpList.cpp(19) : error C2065: 'pdb' : undeclared identifier<BR>E:\vc\projects\MyReport4\EmpList.cpp(20) : error C2448: '<Unknown>' : function-style initializer appears to be a function definition<BR>E:\vc\projects\MyReport4\EmpList.cpp(20) : error C2143: syntax error : missing ';' before ':'<BR>E:\vc\projects\MyReport4\EmpList.cpp(21) : error C2448: '<Unknown>' : function-style initializer appears to be a function definition<BR>E:\vc\projects\MyReport4\EmpList.cpp(65) : error C2065: 'CDaoFieldExchange' : undeclared identifier<BR>E:\vc\projects\MyReport4\EmpList.cpp(65) : error C2065: 'pFX' : undeclared identifier<BR>E:\vc\projects\MyReport4\EmpList.cpp(66) : error C2448: '<Unknown>' : function-style initializer appears to be a function definition<BR>E:\vc\projects\MyReport4\EmpList.cpp(83) : error C2653: 'CDaoRecordset' : is not a class or namespace name<BR>E:\vc\projects\MyReport4\EmpList.cpp(88) : error C2653: 'CDaoRecordset' : is not a class or namespace name<BR>这个为什么呀?有哪位大虾帮我解释一下!谢谢!
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:dstwwx 回复日期:2003-11-28 08:51:51
<br>内容:应该在stdafx.h中增加头文件<BR>#include "afxdao.h"
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:walter0505 回复日期:2003-11-28 09:01:14
<br>内容:谢谢你!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -