编译时连接数据库无出错消息AfxOleInit();
m_pConnection.CreateInstance("ADODB.Connection");
m_pConnection->ConnectionTimeout = 8;
m_pConnection->Open("Driver=SQL Server;Database=IMG;Server=VIRUS;UID=goods;PWD=goods;","","",adModeUnknown);
AfxMessageBox("数据库连接成功!");但加入读出记录集语句时出错
CString strSelectData=_T("SELECT * FROM TB_BYJC_Image ");
bool hr = ADOExecute(m_pRecordset,_variant_t(strSelectData));if(hr)
{......}
else AfxMessageBox("erro!");
ResetControls();出错消息为:
Tis application has requested the Runtime to terminate it in an unusual way,
Please contact the application's support team for mor information.