关于ADO数据库编程的问题,高手请进->急(困扰一天了)
定义
_RecordsetPtr m_pRs 出错
摘录:
1.TestDoc.h
/////////////////////////////////////////////////////////////////
private:
IADORecordBinding* m_piAdoRecordBinding;
CCustomRs m_rsRecSet;
CString m_strConnection;
CString m_strCmdText;
_RecordsetPtr m_pRs;
2.TestDoc.cpp
//////////////////////////////////////////////////////////////////
BOOL CTestDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
m_strConnection=_T("Provider=MSDASQL.1;Data Source=mytest");
m_strCmdText=_T("select * from mytest");
////////////就是下面这个m_pRS////////////////
m_pRs=NULL;
m_piAdoRecordBinding=NULL;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
3.Debug showing
////////////////////////////////////////////////////////////////
Compiling...
TestDoc.cpp
h:\my program\vc++\mfc\test\debug\msado15.tlh(409) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
h:\my program\vc++\mfc\test\testdoc.h(59) : error C2146: syntax error : missing ';' before identifier 'm_pRs'
h:\my program\vc++\mfc\test\testdoc.h(59) : error C2501: '_RecordsetPtr' : missing storage-class or type specifiers
h:\my program\vc++\mfc\test\testdoc.h(59) : error C2501: 'm_pRs' : missing storage-class or type specifiers
H:\My program\VC++\MFC\Test\TestDoc.cpp(51) : error C2065: 'm_pRs' : undeclared identifier
Generating Code...
Compiling...
Test.cpp
h:\my program\vc++\mfc\test\debug\msado15.tlh(409) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
h:\my program\vc++\mfc\test\testdoc.h(59) : error C2146: syntax error : missing ';' before identifier 'm_pRs'
h:\my program\vc++\mfc\test\testdoc.h(59) : error C2501: '_RecordsetPtr' : missing storage-class or type specifiers
h:\my program\vc++\mfc\test\testdoc.h(59) : error C2501: 'm_pRs' : missing storage-class or type specifiers
Generating Code...
Compiling...
TestView.cpp
h:\my program\vc++\mfc\test\debug\msado15.tlh(409) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
h:\my program\vc++\mfc\test\testdoc.h(59) : error C2146: syntax error : missing ';' before identifier 'm_pRs'
h:\my program\vc++\mfc\test\testdoc.h(59) : error C2501: '_RecordsetPtr' : missing storage-class or type specifiers
h:\my program\vc++\mfc\test\testdoc.h(59) : error C2501: 'm_pRs' : missing storage-class or type specifiers
Generating Code...
Error executing cl.exe.
Test.exe - 10 error(s), 3 warning(s)
请问如何进行改正,谢谢!