E:\Program Files\Microsoft Visual Studio\MyProjects\people\peopleView.cpp(247) : error C2601: 'OnPaint' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\people\peopleView.cpp(282) : error C2601: 'InitODBCEnvironment' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\people\peopleView.cpp(331) : error C2601: 'CloseODBCEnvironment' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\people\peopleView.cpp(360) : error C2601: 'OpenDatabase' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\people\peopleView.cpp(382) : error C2601: 'CloseDatabase' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\people\peopleView.cpp(396) : error C2601: 'OpenInitDatabase' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\people\peopleView.cpp(421) : error C2601: 'openDatabase' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\people\peopleView.cpp(476) : error C2601: 'closeDatabase' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\people\peopleView.cpp(491) : error C2601: 'RefreshData' : local function definitions are illegal
E:\Program Files\Microsoft Visual Studio\MyProjects\people\peopleView.cpp(542) : error C2601: 'OnDestroy' : local function 
definitions are illegal这是其中三个声明
BOOL CPeopleView::InitODBCEnvironment(char *szPathName)
{
TCHAR szDesc[2048];
LPCSTR lpszDriver;
HMODULE hmodule;
int nLen;
int ch='\\';
    CString szTemp,szTemp1;
szTemp.Empty();
szTemp1.Empty();
szTemp = szPathName;
int result = szTemp.ReverseFind(ch);
    szTemp1 = szTemp.Left(result); // check if the driver is install and construct the create description string
if (hmodule = ::LoadLibrary(_T("odbcjt32.dll")))
{
_stprintf(szDesc, _T("DSN=%s+ DESCRIPTION=%s+ DBQ=%s+ DEFAULTDIR=%s++ "), 
  DSNNAME, DSNNAME, szPathName, szTemp1); lpszDriver = "Microsoft Access Driver (*.mdb)\0";
::FreeLibrary(hmodule);
}
else
{
::MessageBox(NULL, _T("找不到ODBC驱动程序,请安装\nMicrosoft Access Driver"), 
 _T("错误信息"), MB_OK | MB_ICONERROR); return FALSE;
} nLen = _tcslen(szDesc);
for (int i=0; i<nLen; i++)
{
if (szDesc[i] == _T('+'))
szDesc[i] = 0;
} // create the odbc data source
if (!::SQLConfigDataSource(NULL, ODBC_ADD_DSN, lpszDriver, (LPCSTR)szDesc))
{
::MessageBox(NULL, _T("创建ODBC数据源失败"), _T("错误信息"), MB_OK | MB_ICONERROR);
return FALSE;
} return TRUE;}BOOL CPeopleView::CloseODBCEnvironment(char *szPathName)
{
TCHAR szDesc[MAX_PATH];
LPCSTR lpszDriver;
int nLen, i;
int ch='\\';
    CString szTemp,szTemp1;
szTemp.Empty();
szTemp1.Empty();
szTemp = szPathName;
int result = szTemp.ReverseFind(ch);
    szTemp1 = szTemp.Left(result);
_stprintf(szDesc, _T("DSN=%s+ DESCRIPTION=%s+ DBQ=%s++ "), DSNNAME, DSNNAME,szTemp1);

lpszDriver = "Microsoft Access Driver (*.mdb)\0"; nLen = _tcslen(szDesc);
for (i=0; i<nLen; i++)
{
if (szDesc[i] == _T('+'))
szDesc[i] = 0;
}
BOOL bRes=::SQLConfigDataSource(NULL, ODBC_REMOVE_DSN, lpszDriver, (LPCSTR)szDesc);
if(!bRes)
return FALSE;
return TRUE;}void CPeopleView::OpenDatabase()
{
TCHAR szTempPath[1024];
TCHAR szBuffer[400];
    memset(szBuffer,0,sizeof(szBuffer));
memset(szTempPath,0,sizeof(szTempPath));
CPeopleApp *pApp = (CPeopleApp *)AfxGetApp();
if(::GetModuleFileName(NULL,szBuffer,MAX_PATH)!=0)
{
pApp->GetCurDir(szBuffer,szTempPath);
}
    
lstrcat(szTempPath,"people.mdb");
if(!InitODBCEnvironment(szTempPath))
 return;
 memset(m_szPathName,0,sizeof(m_szPathName));
 lstrcpy(m_szPathName,szTempPath);
 //open the database and init it
 OpenInitDatabase(DSNNAME);}