我写了一个将mysql数据库的内容导入Acces数据库的程序.
连接mysql成功且能读出记录的内容。但在向Access发送sql命令时出项异常,以下为其代码
CString ComTexttmp;
_bstr_t ComText;
ComTexttmp.Format("%s","INSERT INTO table()VALUES());
ComText=ComTexttmp.AllocSysString();
m_pRecordset=m_pConnection->Execute(ComText,NULL,adCmdText);
在执行m_pRecordset=m_pConnection->Execute(ComText,NULL,adCmdText)语句时,发生异常
还有在调试完后,调试窗口会出现以下类似的信息
Loaded 'C:\WINDOWS\SYSTEM\OLEAUT32.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\OLE32.DLL', no matching symbolic information found.
诚心求教各位大虾帮助
连接mysql成功且能读出记录的内容。但在向Access发送sql命令时出项异常,以下为其代码
CString ComTexttmp;
_bstr_t ComText;
ComTexttmp.Format("%s","INSERT INTO table()VALUES());
ComText=ComTexttmp.AllocSysString();
m_pRecordset=m_pConnection->Execute(ComText,NULL,adCmdText);
在执行m_pRecordset=m_pConnection->Execute(ComText,NULL,adCmdText)语句时,发生异常
还有在调试完后,调试窗口会出现以下类似的信息
Loaded 'C:\WINDOWS\SYSTEM\OLEAUT32.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\OLE32.DLL', no matching symbolic information found.
诚心求教各位大虾帮助
解决方案 »
- 多线程问题
- 关于线程同步的问题
- VCReleast版本没办法在没装VC环境下运行
- CSplitterWnd怎么分割成效果的窗口?
- 我是新手,请帮忙.数据转换问题.
- 程序初始化的时候创建新的子窗口,有代码,大侠帮我看看
- ADO+DBF,连接成功,可查询出现这样错误"External table is not in the expected format"
- 如何在CRichEditCtrl中插入背景图片?
- 远程线程注入
- 如何将最小化的程序图标放在Windows右下脚的任务栏内?
- 请问在vc++怎样实现在一个窗体中显示不同的内容,(类似选项卡 tabctrl)(xinyuu)
- 关于msagent的问题,问题解决后,即送300分
// need to free the string after returning from the function call.
你加 SysAllocString 函数释放
ComTexttmp.Format("%s","INSERT INTO table(???)VALUES(???));
_bstr_t ComText(ComTexttmp);
m_pRecordset=m_pConnection->Execute(ComText,NULL,adCmdText);
看看
{
_CommandPtr pCommand;
_RecordsetPtr MySet;
pCommand.CreateInstance(__uuidof(Command));
pCommand->ActiveConnection=m_pConnection;
/////////////////////////////////////////////////////////
pCommand->CommandText=(_bstr_t)m_strSQL;
pCommand->CommandType=adCmdText;
try
{
pCommand->Parameters->Refresh();
pCommand->Execute(NULL,NULL,adCmdUnknown);
}
catch(_com_error e)
{
CString errormessage;
errormessage.Format("错误信息:%s",e.ErrorMessage());
AfxMessageBox(errormessage);
}
}