请教:数据库连接超时的问题
想用以下代码连接数据库,并设置超时时间为10秒,结果没有效果
CString str;
str= "provider=SQLOLEDB;server=SQLServer2000;database=test;uid=lmn;pwd=1 ";
_bstr_t strConnection=(LPCTSTR)_bstr_t(str);
m_pConnection.CreateInstance(__uuidof(Connection));
m_pConnection-> ConnectionTimeout=10;
m_pConnection-> Open(strConnection, " ", " ",adModeUnknown);
------解决方案--------------------Up