日期:2014-05-18 浏览次数:20421 次
try { CoInitialize(NULL); _ConnectionPtr m_pConnection; m_pConnection.CreateInstance(__uuidof(_Connection)); m_pConnection->ConnectionString = "Provider=SQLOLEDB.1;Password=qxd5024278;Persist Security Info=False;User ID=qxd;Data Source=QIN-PC\SQLEXPRESS"; m_pConnection->Open("","","",NULL); } catch(_com_error e) { CString str = e.ErrorMessage(); MessageBox(str); }