我的DBgrid控件刷新不了呀,xdjm们帮忙啊
gaboy 2004-05-10 02:43:40 我用的是odbc、remotedata control、dbgrid
先是提示更新或删除失败 对应的编辑框里面有数据 但是dbgrid里面没有 关闭程序再打开就有了
然后又尝试用了remotedata control、dbgrid这两个控件的refresh(),但是执行到remotedata control的refresh()的时候终止程序
怎么回事?? 救救小弟哈
CRTerminalView* pView=(CRTerminalView*)this->GetActiveView();
CRTerminalSet* pSet=pView->m_pSet;
pSet->AddNew();
srand( (unsigned)time( NULL ) );//模拟发送数据
CString str;
for(i=1;i<=8;i++)
{
str.Format("3%d",rand());
pSet->m_objnum=str;
pSet->m_objdis=str;
pSet->m_objspeed=str;
pSet->m_objangle=str;
if(pSet->CanUpdate())
{
pSet->Update();
}
if(!pSet->IsEOF())
{
pSet->MoveLast();
}
pView->m_Dbgrid.Refresh();
pView->UpdateData(FALSE);
}