SQL到这里后就死循环了,程序窗体出不来
ohfox 2005-11-17 02:20:47 ConnectDB()是 OnInitDialog()程序中最后调用的一个函数
void CIndustryDlg::ConnectDB()
{
if(m_pConnection)
m_pConnection->Close();
//初始化Connection 指针
m_pConnection.CreateInstance (_uuidof(Connection));
m_pRecordset.CreateInstance (_uuidof(Recordset));
try
{
CString strConnect;
strConnect.Format ("Provider=SQLOLEDB.1;Password=%s;User ID=%s;Data Source=%s;Persist Security Info=True",m_strDBPwd,m_strDBUser,m_strDBSource);
//连接数据库
m_pConnection->Open ((_bstr_t)strConnect,"","",-1); //**********************
}
catch(_com_error e)
{
AfxMessageBox(e.ErrorMessage ());
}
调试发现运行到***********的那一行后就不动了,最后的窗体也出不来,在任务管理器中可以看到进程,请问这是为什么啊?