按钮弹出窗口,窗口初始化代码如下BOOL Zdjgdlg::OnInitDialog()
{
CDialog::OnInitDialog();
HRESULT hr;
try
{
hr=m_pRs.CreateInstance("ADODB.Recordset");
if(SUCCEEDED(hr))
{
CString sql="select * from 菜名表";
m_pRs=theApp.m_pCon->Execute((_bstr_t)sql,NULL,adCmdText);
CString jl=(char*)(_bstr_t)m_pRs->GetCollect("菜名");
SetDlgItemText(IDC_STATIC,jl);
m_pRs->Update();
m_pRs->Close();
}
}
catch(_com_error e)
{
CString errorMessage;
errorMessage.Format("建立记录表错误\r\n错误信息:%s",e.ErrorMessage());
AfxMessageBox(errorMessage);
} return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
运行时,从数据库读数据正常,给静态文本框写数据正确,但弹出窗口之前,有下列提示错误
这是什么问题呢??代码运行正常啊,高手指点一下吧
{
CDialog::OnInitDialog();
HRESULT hr;
try
{
hr=m_pRs.CreateInstance("ADODB.Recordset");
if(SUCCEEDED(hr))
{
CString sql="select * from 菜名表";
m_pRs=theApp.m_pCon->Execute((_bstr_t)sql,NULL,adCmdText);
CString jl=(char*)(_bstr_t)m_pRs->GetCollect("菜名");
SetDlgItemText(IDC_STATIC,jl);
m_pRs->Update();
m_pRs->Close();
}
}
catch(_com_error e)
{
CString errorMessage;
errorMessage.Format("建立记录表错误\r\n错误信息:%s",e.ErrorMessage());
AfxMessageBox(errorMessage);
} return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
运行时,从数据库读数据正常,给静态文本框写数据正确,但弹出窗口之前,有下列提示错误
这是什么问题呢??代码运行正常啊,高手指点一下吧
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货