哪位能帮忙解决一下以下是出错提示:
--------------------Configuration: TestEx - Win32 Debug--------------------
Compiling...
TestExDlg.cpp
G:\Experiment\TestEx\TestEx\TestExDlg.cpp(115) : error C2065: 'theApp' : undeclared identifier
G:\Experiment\TestEx\TestEx\TestExDlg.cpp(115) : error C2228: left of '.m_pConnection' must have class/struct/union type
?′DD cl.exe ê±3?′í.
下面是本页代码:// TestExDlg.cpp : implementation file
//#include "stdafx.h"
#include "TestEx.h"
#include "TestExDlg.h"
//#include "TestEx.cpp"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App Aboutclass CAboutDlg : public CDialog
{
public:
CAboutDlg();// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA // ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
//}}AFX_VIRTUAL// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CTestExDlg dialogCTestExDlg::CTestExDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTestExDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CTestExDlg)
m_date = _T("");
m_event = _T("");
m_time = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}void CTestExDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTestExDlg)
DDX_Control(pDX, IDC_LIST3, m_userlist);
DDX_Text(pDX, IDC_DATE, m_date);
DDX_Text(pDX, IDC_EVENT, m_event);
DDX_Text(pDX, IDC_TIME, m_time);
//}}AFX_DATA_MAP
}BEGIN_MESSAGE_MAP(CTestExDlg, CDialog)
//{{AFX_MSG_MAP(CTestExDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST3, OnItemchangedList3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CTestExDlg message handlersBOOL CTestExDlg::OnInitDialog()
{ CDialog::OnInitDialog();
// m_cDelItem.EnableWindow(FALSE);
::SendMessage(m_userlist.m_hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
//////////?aáD±í???tìí?óáD//////////
// m_userlist.InsertColumn(0,"ó??§ID",LVCFMT_LEFT,60);
m_userlist.InsertColumn(0,"è??ú",LVCFMT_LEFT,100);
m_userlist.InsertColumn(1,"ê±??",LVCFMT_LEFT,100);
m_userlist.InsertColumn(2,"ê??t",LVCFMT_LEFT,60); //////////?áè?êy?Y?a?Dμ?D??¢ìí?óμ?áD±í???t///////////
int nItem;
_variant_t vUsername,vBirthday,vID,vOld;
try
{
m_pRecordset.CreateInstance("ADODB.Recordset");
/*就这里引用了全局对象::*/
m_pRecordset->Open("SELECT dates,times,keyword FROM user",_variant_t((IDispatch*)theApp.m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText);
m_bSuccess = TRUE;
while(!m_pRecordset->adoEOF)
{
vDates = m_pRecordset->GetCollect("dates");
vTimes = m_pRecordset->GetCollect("times");
vKeyword= m_pRecordset->GetCollect("keyword");

nItem=m_userlist.InsertItem(0xffff,(_bstr_t)vDates);
m_userlist.SetItem(nItem,1,1,(_bstr_t)vTimes,NULL,0,0,0);
m_userlist.SetItem(nItem,2,1,(_bstr_t)vKeyword,NULL,0,0,0);
//m_userlist.SetItem(nItem,3,1,(_bstr_t)vBirthday,NULL,0,0,0); m_pRecordset->MoveNext();
}
}
catch(_com_error e)///2?×?òì3£
{
AfxMessageBox("?áè?êy?Y?a꧰ü!");///??ê?′í?óD??¢
}
// Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
} // Set the icon for this dialog.  The framework does this automatically
//  when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

// TODO: Add extra initialization here

return TRUE;  // return TRUE  unless you set the focus to a control
}void CTestExDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.void CTestExDlg::OnPaint() 
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}// The system calls this to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CTestExDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}void CTestExDlg::OnItemchangedList3(NMHDR* pNMHDR, LRESULT* pResult) 
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
    if(pNMListView->uNewState&LVIS_SELECTED)
{
UpdateData();
// SaveData();///±£′??éêy?Y
m_nCurrentSel = pNMListView->iItem;
// LoadData();///?ó??D?êy?Y
//m_cDelItem.EnableWindow();
} *pResult = 0;
}void CTestExDlg::LoadData()
{
m_pRecordset->Move(m_nCurrentSel,_variant_t((long)adBookFirst));
// vUserID = m_pRecordset->GetCollect("ID");
// vUsername = m_pRecordset->GetCollect("username");
// vOld = m_pRecordset->GetCollect("old");
// vBirthday = m_pRecordset->GetCollect("birthday");
// m_nUserID = vUserID.lVal;
// m_sUsername = (LPCTSTR)(_bstr_t)vUsername;
// m_nOld = vOld.lVal;
// m_tBirthday = vBirthday;
UpdateData(FALSE);
}/////??±à?-?òμ?êy?Y±£′?μ??????ˉó?áD±í?ò
void CTestExDlg::SaveData()
{
/* if(!m_pRecordset->adoEOF && m_nCurrentSel >= 0 && m_bAutoSave)
{
vUserID = (long)m_nUserID;
vUsername = m_sUsername;
vOld = (long)m_nOld;
vBirthday = m_tBirthday;
m_pRecordset->PutCollect("ID",vUserID);
m_pRecordset->PutCollect("username",vUsername);
m_pRecordset->PutCollect("old",vOld);
m_pRecordset->PutCollect("birthday",vBirthday);
m_userlist.SetItem(m_nCurrentSel,0,LVIF_TEXT,(_bstr_t)vUserID,NULL,0,0,0);
m_userlist.SetItem(m_nCurrentSel,1,LVIF_TEXT,(_bstr_t)vUsername,NULL,0,0,0);
m_userlist.SetItem(m_nCurrentSel,2,LVIF_TEXT,(_bstr_t)vOld,NULL,0,0,0);
m_userlist.SetItem(m_nCurrentSel,3,LVIF_TEXT,(_bstr_t)vBirthday,NULL,0,0,0);
}*/
}