补充一点,后来我又进行了查询的操作,结果CityName可以显示出来:不知道为何在aceess表中看到add的CityName是“Add"
void CCityView::OnRecordFind() 
{
// TODO: Add your command handler code here
CCFindCityID  oFindIt;
BOOL       bFound=FALSE;
CDBVariant   varBook; //positioning book if(oFindIt.DoModal()==IDOK)
{
//Save current position
if(m_pSet->CanBook())
   m_pSet->GetBook(varBook);

//go to the beginning of the query and search
//for the CityID entered by user
m_pSet->MoveFirst();
while(!(m_pSet->IsEOF()||bFound))
{
if(m_pSet->m_cityID==oFindIt.m_cityID_toFind)
bFound=TRUE;
else
m_pSet->MoveNext(); } if(!bFound)
{
MessageBox("Record not found!"); if(m_pSet->CanBook())
//restore the curent position if
//the database supports book
m_pSet->SetBook(varBook);
else
//otherwise,move to the first record
m_pSet->MoveFirst();
}
else
{
//display the data in the new record
CString tempcityID;
tempcityID.Format("%d",m_pSet->m_cityID);
m_CityID.SetWindowText(tempcityID);
m_CityName.SetWindowText(m_pSet->m_cityName);
}

} //IDOK