ado debug--there is a KERNEL32.DLL Exception in my app.
there is a KERNEL32.DLL Exception in my app.
I am writing a database application using ado.there is some bug in following codes,but I can't debug.
My codes are as follow:
...Initializing
001 m_pConnection.CreateInstance("ADODB.Connection");
002 m_pConnection->Open("Provider=sqloledb;Data Source=;Integrated 003 Security='SSPI';Initial Catalog=pipedb;UserId=;Password=;",
"","",adModeUnknown);
004 m_pRecordset.CreateInstance("ADODB.Recordset");
005 m_pRecordset->Open("SELECT * FROM pipe",
_variant_t((IDispatch *)m_pConnection,true),
adOpenDynamic,adLockPessimistic,adCmdText);
...data access
006 m_pRecordset->AddNew();
007 m_pRecordset->PutCollect("pipeNo",_variant_t(m_strPipeNo));
008 TRACE("\n\nThis is debug code\n\n");
009 m_pRecordset->PutCollect("zoneNo",_variant_t(m_strZoneNo));
010 m_pRecordset->Update();
...
when running the application ,the exception break out at 007,the VC++ debug promotes "Unhandled exception in MyGis.exe (KERNEL32.DLL):0xE06D7363:Microsoft C++"
Exception
问题点数:50、回复次数:2Top
1 楼bysen()回复于 2003-06-01 11:17:36 得分 50
我也经常遇到这种错误,产生的原因个人感觉是对数据的读取和更新有错误,你试试把“pipeNo”改成column的编号试试,还有确定你的_variant_t变量没有错误。Top
2 楼chenweihello(呼噜噜~~~~~~~~~~)回复于 2003-06-01 11:29:22 得分 0
帮你顶了Top




