简体   繁体   English

Excel中的SQL Azure连接字符串出现问题

[英]Issue with SQL Azure connection string in Excel

I am trying to create a connection string which contains SQL login information for use in Excel 我正在尝试创建一个包含SQL登录信息以在Excel中使用的连接字符串

The connection string I have been using is: 我一直在使用的连接字符串是:

Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=vw-AdventureWorks;Extended Properties=""

Which works fine, but when adding user/password fields, like this 效果很好,但是在添加用户/密码字段时,就像这样

Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=vw-AdventureWorks;User ID=[Id]@[server];Password=[password];Extended Properties=""

It throws an error stating the initialization of the database has failed, but the database is verified to be up and the string connects perfectly fine without the user/password fields 它引发错误,表明数据库初始化失败,但已验证数据库已启动,并且字符串没有用户/密码字段,连接正常

I solved my issue with the following connection string. 我使用以下连接字符串解决了我的问题。 I still don't know why the original one could not connect. 我仍然不知道为什么原来的那个无法连接。

Server=tcp:[server].database.windows.net,1433;Data Source=[databasename];Initial Catalog=[database name];User ID=[Username];Password=[Password];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM