Excel VBA - 使用可信连接连接到sql(no uid / pwd) [英] Excel VBA - connect to sql with a trusted connection (no uid/pwd)
本文介绍了Excel VBA - 使用可信连接连接到sql(no uid / pwd)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法让Excel连接到Sql Server使用当前用户的网络Windows身份验证(可信连接/集成安全)?我不想依赖于sql登录或在我的代码中使用uid /密码。
Is there a way to have Excel connect to Sql Server using the current user's network windows authentication (trusted connection/integrated security)? I don't want to rely on a sql login or have a uid/password in my code.
推荐答案
Driver={SQL Native Client};server=servernamehere;database=dbnamehere;Trusted_Connection=yes;
http://www.sqlstrings.com/SQL-Server-connection-strings.htm
http://www.connectionstrings.com/sql-server
尝试这一个:
Provider=sqloledb;Data Source=myServerName;Initial Catalog=myDatabaseName;Integrated Security=SSPI
这篇关于Excel VBA - 使用可信连接连接到sql(no uid / pwd)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文