主题:菜鸟求救!
作一个添加记录的程序
代码如下:运行是老是跳出对话框It is not allow to add records to the datasource为什么?
void CadminsView::OnRecordAdd()
{
CInsert *DIALOG2=new CInsert();
if(DIALOG2->DoModal()==IDOK)
{if(m_pSet->CanAppend())
{m_pSet->AddNew();
m_pSet->m_biao2name=DIALOG2->name;
m_pSet->m_biao2brand=DIALOG2->brand;
m_pSet->m_biao2size=DIALOG2->size;
m_pSet->m_biao2price=atof(DIALOG2->price.GetBuffer(0));
m_pSet->m_biao2place=DIALOG2->place;
m_pSet->m_biao2intime=DIALOG2->intime;
m_pSet->m_biao2recorder=DIALOG2->recorder;
m_pSet->m_biao2rectime=DIALOG2->rectime;
m_pSet->Update();
UpdateData(FALSE);
}
else{AfxMessageBox("It is not allow to add records to the datasource");}
}//delete DIALOG2;
}
代码如下:运行是老是跳出对话框It is not allow to add records to the datasource为什么?
void CadminsView::OnRecordAdd()
{
CInsert *DIALOG2=new CInsert();
if(DIALOG2->DoModal()==IDOK)
{if(m_pSet->CanAppend())
{m_pSet->AddNew();
m_pSet->m_biao2name=DIALOG2->name;
m_pSet->m_biao2brand=DIALOG2->brand;
m_pSet->m_biao2size=DIALOG2->size;
m_pSet->m_biao2price=atof(DIALOG2->price.GetBuffer(0));
m_pSet->m_biao2place=DIALOG2->place;
m_pSet->m_biao2intime=DIALOG2->intime;
m_pSet->m_biao2recorder=DIALOG2->recorder;
m_pSet->m_biao2rectime=DIALOG2->rectime;
m_pSet->Update();
UpdateData(FALSE);
}
else{AfxMessageBox("It is not allow to add records to the datasource");}
}//delete DIALOG2;
}