连接字符串不起作用 [英] Connection String Not Working

查看:131
本文介绍了连接字符串不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个SQL服务器数据库(SQL Server 2008 R2),我使用我的经典asp网络应用程序。



我最近使用SQL Server Management studio创建了一个具有匹配凭据的登录名和用户。我将登录详细信息修改为我的连接字符串。我无法再连接到数据库了。



请协助,我还在这个领域学习



我的初始字符串:Provider = SQLOLEDB; data source =(local); Integrated Security = SSPI; Initial Catalog = myDBName; Trusted_Connection = Yes



新字符串: Provider = SQLOLEDB; data source =(local); Database = JointsDB; Uid = myUser; Pwd = myPassword

Hi

I have a SQL server DB (SQL Server 2008 R2) that I use with my classic asp web app.

I recently created a login and user with matching credentials using SQL Server Management studio. I amended the login details to my connection string. I can no longer connect to the database.

Please assist, I am still learning in this field

My initial string: " Provider = SQLOLEDB; data source=(local);Integrated Security=SSPI; Initial Catalog= myDBName; Trusted_Connection=Yes"

New string: " Provider = SQLOLEDB; data source=(local); Database= JointsDB; Uid= myUser; Pwd= myPassword"

推荐答案

您将服务器身份验证设置为什么?

这两个选项是Windows身份验证模式或SQL Server和Windows身份验证模式。

您最有可能需要将身份验证模式更改为第二个。

要执行此操作,请打开Management Studio并连接到SQL Server。

连接后,右键单击顶部服务器节点,然后选择属性。

在左侧的弹出窗口中选择Security页面。

在安全页面上,top选项是您要更改为允许SQL登录的选项(连接字符串)用户名和密码)和Windows登录(可信连接字符串)。
What did you set the server authentication to?
The two options are Windows Authentication Mode or SQL Server and Windows Authentication Mode.
You most likely need to change the authentication mode to the second one.
To do this open Management Studio and connect to your SQL Server.
Once connected right click the top server node and then select properties.
In the popup on the left hand side select the Security page.
On the security page the top option is the one you want to change to allow SQL Logins(connection string with username and password) and Windows logins(trusted connection strings).






你似乎不是正确创建连接字符串。



看看这里



这样的事情会更好:

Hi,

you don't seem to be creating your connection string properly.

Have a look here.

Something like this should be better:
"Provider=SQLOLEDB;data source=(local);User id=myUser;Password=myPassword;Initial Catalog=JointsDB"





希望它有所帮助。



Hope it helps.


这篇关于连接字符串不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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