如何使用VBA将SQL Server 2012数据库连接到Excel [英] How do I connect SQL Server 2012 Database to Excel using VBA

查看:87
本文介绍了如何使用VBA将SQL Server 2012数据库连接到Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我从网络托管服务提供商处购买了虚拟专用服务器(VPS)。它有一个专用的SQL Server安装在其中。我正在尝试使用ADODB连接从Excel连接到数据库。它给出以下错误。



[DBNETLIB] ConnectionOpen(Connect()] SQL Server不存在或访问被拒绝。



我已经尝试了各种网站建议的几种解决方案,但没有任何效果。根据我从提供商处收到的信息,这应该是可能的。



连接字符串使用:



Provider = SQLOLEDB; Server = xxxxxxx \SQLEXRESS; Database = xxx; Trusted_Connection = True; Integrated Security = SSPI;



请帮忙吗?



谢谢

Raj

Hi,

I have purchased a Virtual Private Server (VPS) from a web hosting providers. It has a dedicated SQL Server Installed in it. I am trying to connect to the database from Excel using ADODB connection. It gives the following error.

[DBNETLIB]ConnectionOpen(Connect()]SQL Server does not exist or access denied.

I have tried several solutions suggested by various sites, but nothing works out. As per the information I received from the providers, this should be possible.

Connection String used:

"Provider=SQLOLEDB; Server=xxxxxxx\SQLEXRESS; Database=xxx; Trusted_Connection=True;Integrated Security=SSPI; "

Can any one help please?

Thanks
Raj

推荐答案

我建​​议更改连接字符串: http://www.connectionstrings.com/sql-server / [ ^ ]使用IP和用户名局域网外的每个服务器通常都使用自定义授权;)



不是e有足够的信息来发布更详细的答案。
I'd suggest to change connection string: http://www.connectionstrings.com/sql-server/[^] to which uses IP and username and password. Each server outside the LAN usually uses custom authorization ;)

Not enough information to post more detailed answer.


这篇关于如何使用VBA将SQL Server 2012数据库连接到Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆