日期:2014-05-18 浏览次数:20463 次
HRESULT hr = m_conn.CreateInstance(__uuidof(Connection)); if( FAILED(hr)) { CString sMsg; sMsg.Format("CreateInstance失败,0x%u",hr); TRACE("数据库连接失败!%s\r\n",sMsg); throw sMsg; } CString conn = "Provider=SQLOLEDB;Server=127.0.0.1;Database=db_test;uid=sa;pwd=sa;"; if(FAILED(m_conn->Open((_bstr_t)conn,"","",-1)))