m_Price是float型
m_Month是ctime型
其它是cstring型
错误提示:弹出错误对话框,×××.exe-应用程序错误,………………该内存不能为"read"
高手急救~~~~到底应该如何写
C/C++ code:
void CDailyAccountDlg::OnAdd()
{
UpdateData();
CString sql;
CoInitialize(NULL);
_ConnectionPtr pCon(__uuidof(Connection));
_RecordsetPtr pRst(__uuidof(Recordset));
try
{
pCon->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dailyAccount.mdb", "", "", adConnectUnspecified);
try
{
sql.Format("insert into daily(category,event,price,describe,date)values('%s','%s','%d','%s',#%s#)",csg_Category,csg_Event,m_Price,m_Desc,m_Month);
pRst->Open((_bstr_t)sql, _variant_t((IDispatch*)pCon), adOpenDynamic, adLockUnspecified, adCmdText);
}
catch(_com_error e)
{
AfxMessageBox("数据插入失败!");
}
}
catch(_com_error e)
{
AfxMessageBox("数据库连接失败!");
}
pRst->Close();
pCon->Close();
pRst.Release();
pCon.Release();
CoUninitialize();
}
你catch的时候就不能把错误信息显示出来吗?
C/C++ code
Code highlighting pro
这两天学习《Delphi技术方案宝典》一书中第三章关于用户登录方案的例子,利用的是SQl Server数据库实现用户登录,编译运行都没问题,该实现的功能也都实现的很好,但是奇怪的是,反复运行一段时间后,有时在关闭整个 ......