windows验证模式的ado连接问题

whbjtam 2003-06-14 12:53:18
我的程序以前是ado连接,sql用sql验证模式连接的,现想改为windows验证模式,
sql服务器同时也是域控制器,程序在连接sql时出现错误,各位有没有知道ado连接windows验证模式下认证sql写法的?
先谢啦!
...全文
41 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
fckadxz 2003-06-16
  • 打赏
  • 举报
回复
to saucer:you are so kind!

your proposal make me beleave that the best way to learn programing is communication and the best site to learn programing on windows is MSDN.
saucer 2003-06-15
  • 打赏
  • 举报
回复
as far as the connection string is concerned, there is no difference between vc and vb, for example, from

http://msdn.microsoft.com/library/en-us/ado270/htm/mdaexamples_vc02_6.asp?frame=true

TESTHR(pConnection1.CreateInstance(__uuidof(Connection)));
pConnection1->ConnectionString =
"Provider='sqloledb';Data Source='MySqlServer';"
"Initial Catalog='Pubs';Integrated Security='SSPI';";
pConnection1->ConnectionTimeout = 30;
pConnection1->Open("","","",adConnectUnspecified);
fckadxz 2003-06-15
  • 打赏
  • 举报
回复
up
whbjtam 2003-06-15
  • 打赏
  • 举报
回复
to saucer:谢谢,我猜你在国外。我的程序是vc编写的,我对vb一窍不通,vc写法该如何?我总觉得国内ado相关的书太少,也可能是因为我对com不了解。看了很多种ado连接的写法,一知半解,我得到的错误信息是“未与sql建立信任连接“。试了很多我所知道的写法都不行。

saucer 2003-06-14
  • 打赏
  • 举报
回复
what error did you get? try something like

oConn.Open "Provider=sqloledb;" & _
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"Integrated Security=SSPI"

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧