::CoInitialize(NULL);
_ConnectionPtr pcom;
_RecordsetPtr pRs;
pcom.CreateInstance(_uuidof(Connection));
pcom->Open("DNS=TestDataBase","","",NULL);
pRs.CreateInstance(_uuidof(Recordset));
pRs->Open("selete *from PersonInfor",
pcom.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
pRs->Close();
pcom->Close();
::CoUninitialize();
我一运行以上的代码,就弹出一个(Microsoft C++ Runtime Libarary )对话框
Runtime error
This is application has request the runtime to terminate it in a unusually way. pleaset contact the application's support team for more information
!!!!!!!!!!!
是不是我的编译器的参数设置错了,还是哪里
_ConnectionPtr pcom;
_RecordsetPtr pRs;
pcom.CreateInstance(_uuidof(Connection));
pcom->Open("DNS=TestDataBase","","",NULL);
pRs.CreateInstance(_uuidof(Recordset));
pRs->Open("selete *from PersonInfor",
pcom.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
pRs->Close();
pcom->Close();
::CoUninitialize();
我一运行以上的代码,就弹出一个(Microsoft C++ Runtime Libarary )对话框
Runtime error
This is application has request the runtime to terminate it in a unusually way. pleaset contact the application's support team for more information
!!!!!!!!!!!
是不是我的编译器的参数设置错了,还是哪里
我用CDatabase 和CRecordset两个类,实现的如下时
CDatabase db;
db.Open("TestDataBase");
CRecordset rs(&db);
if(rs.IsOpen())
rs.Close();
rs.Open(CRecordset::snapshot);///////////在这个地方也出错了。当我从CRcordset继承一个类CRecordDB时 如下的代码,却没有什么问题,我想搞清楚我以上的问题出在哪里
CDatabase db;
db.Open("TestDataBase");
CRecordsetDB rs(&db);////////CRecordsetDB 非CRecordset
if(rs.IsOpen())
rs.Close();
rs.Open(CRecordset::snapshot);