积极答复者
vc中使用ado连接sql server2008数据库

问题
-
自己机器上面可以登陆,可是拿到别人的机器上就无法登陆了我在vc中调用的语句是这样的:
m_pConnection->Open("provider=SQLOLEDB;Data Source=192.168.1.2;Initial catalog=sql数据库;\
Integrated Security=SSPI;","qss","123456",::adModeUnknown);本机上可以登陆,别人机器上不可以,用户名之前用过sa,但是登陆不上,所以创了个用户名还是登陆不上。提示
消息
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. [客户端: 192.168.1.3]求解决办法。
- 已移动 Sheng Jiang 蒋晟 2012年6月23日 12:16 (发件人:Visual C++)
答案
全部回复
-
若你想要变更成混合式验证,可以参考MSDN上的文章。
http://msdn.microsoft.com/zh-cn/library/ms188670.aspx
以上說明若有錯誤請指教,謝謝。
http://www.dotblogs.com.tw/terrychuang/ -
Integrated Security=SSPI;您说表示是windows身份验证,请问怎么改可以表示为是sql身份验证呢?我是直接把那句话删除就可以远程连接了。因为我用的是_ConnectionPtr智能指针的Open方法来连接数据库的,而我只是个数据库的初学者,可否提示下怎么在_ConnectionPtr智能指针的Open方法中连接sql数据库呢?具体每个参数代表什么意思?有没有这方便的帮助文档,还请帮下忙。
You can find different kind of connection strings here: http://www.connectionstrings.com/sql-server-2008