开发的一个程序,使用sql2005企业版正常,但在别的机器上安装的express版连接失败。
- C/C++ code
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)))请问这个连接字符在express上使用是否正确??
[解决办法]
正确啊。。