34,590
社区成员
发帖
与我相关
我的任务
分享
CString strConnection;
strConnection.Format(_T("Driver={SQL Server};Server=%s;Database=%s;Uid=%s;Pwd=%s;Connection Lifetime=0"),
m_strDatabaseServer, m_strDatabaseSource, m_strDatabaseUsername, m_strDatabasePassword);
感谢楼上各位的热心解答,但是还是没效果..."Driver={SQL Server}; Server=%s; Database=%s; Uid=%s; Pwd=%s; Connection Lifetime=10"
改了,也没作用。"Driver={SQL Server}; Server=%s; Database=%s; Uid=%s; Pwd=%s; Connect Timeout=1"//超时时间Connect Timeout
_ConnectionPtr _connectionPtr;
_connectionPtr.CreateInstance(__uuidof(Connection));
......
_connectionPtr->Open("Driver={SQL Server};Server=%s;Database=%s;Uid=%s;Pwd=%s";, "", "", adConnectUnspecified);