登录失败连接到SQL Server [英] Logon Failed connecting to SQL Server

查看:107
本文介绍了登录失败连接到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了MSDN演练使用

Visual C#或Visual Basic创建Web应用程序。当我运行该示例时,我得到登录失败的

用户''dbuser''"在具有SqlDataAdapter1.Fill(dSet)的行处。 SQL服务器

设置为混合模式,我在企业管理器中登录

dbuser帐户。我在客户端上设置了一个ODBC系统DSN,成功测试了
。在Visual Studio 2003中,我选择了预览数据...。对于

SqlDataAdapter1,它成功填充了数据集。我不明白为什么

这两种方法可以访问数据库,但是aspx页面没有。我已经检查了每种方法的用户名和密码。有什么东西

我忽略了吗?我正在尝试这个以本地管理员身份登录客户端计算机而不是域帐户,但是我不认为这会是b / b
差异,因为它是SQL服务器登录和其他两个

方法在此登录下工作。任何帮助将不胜感激。

解决方案

显示你的连接字符串。


Eliyahu


" David Tilman" <沓********* @ discussions.microsoft.com>在消息中写道

新闻:A3 ********************************** @ microsof t.com ...

我已经完成了MSDN演练使用Visual C#或Visual Basic创建Web应用程序。当我运行样本时,我得到登录失败的
用户''dbuser''在具有SqlDataAdapter1.Fill(dSet)的行处。 SQL
服务器设置为混合模式,我在企业管理器中登录
dbuser帐户。我已在客户端上设置了ODBC的系统DSN,并成功进行了测试。在Visual Studio 2003中,我选择了预览数据...。对于成功填充数据集的SqlDataAdapter1。我不明白
为什么这两种方法可以访问数据库,但是aspx页面没有。我已经检查了每种方法的用户名和密码。有没有
我忽略了什么?我在客户端计算机上以本地管理员身份登录而不是作为域帐户尝试此操作,但我不认为
这会有所不同,因为它是SQL服务器登录和其他两个
方法在此登录下工作。任何帮助将不胜感激。



您的Sql Server可能设置为使用Windows身份验证而不是

混合模式。 />
如果您正在运行MSDE,请尝试以下操作。

MSDE 2000(无企业管理)

开始 - >运行 - > regedit - >

HKLM / Software / Microsoft / MSSQLServer / MSSQLServer / LoginMode

该值为1,需要更改为2.


SQL Server 2000(使用企业管理器)

·打开SQL Server企业管理器

开始菜单>节目> Microsoft SQL Server>企业管理器)

·扩展树控件直到你可以使用服务器

·右键单击服务器名称和SQL Server属性

(配置)窗口将打开

·选择安全选项卡

·对于身份验证,选择SQL Server和Windows


我使用的是SQL Server 2000,而不是MSDE,它是为混合模式设置的。如果它是
不是混合模式,我认为ODBC或显示日期在VS中会失败,

但我可能是错的。 dbuser acount是在企业管理器中创建的,

不是Active Directory。

" re **** @ community.nospam"写道:

您的Sql Server可能设置为使用Windows身份验证而不是混合模式。
如果您正在运行MSDE,请尝试以下操作。
MSDE 2000(无企业管理)
开始 - >运行 - > regedit - >
HKLM / Software / Microsoft / MSSQLServer / MSSQLServer / LoginMode
值为1,需要更改为2.

用于带有Enterprirse Manager的SQL Server
SQL Server 2000(使用企业管理器)
?打开SQL Server企业管理器
开始菜单>节目> Microsoft SQL Server>企业管理器)
?·扩展树控件,直到你可以使用服务器?·右键单击服务器名称和SQL Server属性
(配置)。窗口将打开
?选择安全选项卡
?对于身份验证,选择SQL Server和Windows



I''ve gone throught the MSDN walkthrough "Creating a Web Application Using
Visual C# or Visual Basic". When I run the sample I get "Login failed for
user ''dbuser''" at the line with "SqlDataAdapter1.Fill(dSet)". The SQL server
is setup for mixed mode and I have a login in Enterprise Manager for the
dbuser account. I''ve setup a system DSN in ODBC on the client which tested
succesfully. In Visual Studio 2003 I''ve chosen "Preview Data..." for the
SqlDataAdapter1, which successfully fills the dataset. I don''t understand why
those two methods can access the database, but the aspx page doesn''t. I''ve
triple checked the username and password for each method. Is there something
I''ve overlooked? I''m attempting this while logged in as the local admin on
the client computer instead of as a domain account, but I wouldn''t think this
would make a difference since it''s a SQL server login and the other two
methods work under this login. Any help would be appreciated.

解决方案

Show your connection string.

Eliyahu

"David Tilman" <Da*********@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...

I''ve gone throught the MSDN walkthrough "Creating a Web Application Using
Visual C# or Visual Basic". When I run the sample I get "Login failed for
user ''dbuser''" at the line with "SqlDataAdapter1.Fill(dSet)". The SQL server is setup for mixed mode and I have a login in Enterprise Manager for the
dbuser account. I''ve setup a system DSN in ODBC on the client which tested
succesfully. In Visual Studio 2003 I''ve chosen "Preview Data..." for the
SqlDataAdapter1, which successfully fills the dataset. I don''t understand why those two methods can access the database, but the aspx page doesn''t. I''ve
triple checked the username and password for each method. Is there something I''ve overlooked? I''m attempting this while logged in as the local admin on
the client computer instead of as a domain account, but I wouldn''t think this would make a difference since it''s a SQL server login and the other two
methods work under this login. Any help would be appreciated.



Your Sql Server is probably set to use Windows Authentication and not
Mixed Mode.
if you are running MSDE then try the following.
MSDE 2000 (without Enterprise Manage)
Start -> Run -> regedit ->
HKLM/Software/Microsoft/MSSQLServer/MSSQLServer/LoginMode
The value will be 1 and needs to be changed to 2.

for SQL Server with Enterprirse Manager
SQL Server 2000 (using Enterprise Manager)
· Open The SQL Server Enterprise Manager
Start menu > Programs > Microsoft SQL Server > Enterprise Manager)
· Expand the tree-control until you can your server
· Right click on the server name and "SQL Server Properties
(Configure)" window will open
· Select the Security tab
· For "Authentication", select "SQL Server and Windows"


I''m Using SQL Server 2000, not MSDE and it is setup for mixed mode. If it
wasn''t mixed mode, I think the ODBC or "show date" in VS would have failed,
but I could be wrong. The "dbuser" acount was created in Enterprise Manager,
not Active Directory.
"re****@community.nospam" wrote:

Your Sql Server is probably set to use Windows Authentication and not
Mixed Mode.
if you are running MSDE then try the following.
MSDE 2000 (without Enterprise Manage)
Start -> Run -> regedit ->
HKLM/Software/Microsoft/MSSQLServer/MSSQLServer/LoginMode
The value will be 1 and needs to be changed to 2.

for SQL Server with Enterprirse Manager
SQL Server 2000 (using Enterprise Manager)
?· Open The SQL Server Enterprise Manager
Start menu > Programs > Microsoft SQL Server > Enterprise Manager)
?· Expand the tree-control until you can your server
?· Right click on the server name and "SQL Server Properties
(Configure)" window will open
?· Select the Security tab
?· For "Authentication", select "SQL Server and Windows"



这篇关于登录失败连接到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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