sqlserver连接 - 拼命需要帮助! [英] sqlserver connection - need help desperately!

查看:73
本文介绍了sqlserver连接 - 拼命需要帮助!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用asp.net 1.1。 vb.net 2003.


我正在尝试连接到虚拟机上的远程sql server 2000

运行Windows 2000服务器。我可以通过

visual studio中的服务器资源管理器连接,但无法通过代码连接。我之前已经完成了这件事,并且现在无法做到这一点。我不知道发生了什么变化。 (我也无法通过代码连接到

本地Access数据库,虽然我可以从服务器资源管理器。)


代码是:

conn = New SqlConnection(" data source = SERVERNAME; initial

catalog = DATABASE; user id = sa")


代码在conn处失败.open",返回以下错误消息:SQL

服务器不存在或访问被拒绝。


SQL Server身份验证设置为 ; sqlsever和windows当然,

sa帐户存在,没有密码(虽然我设置

密码也不行。)


请帮忙。我真的很绝望,在这里。


Using asp.net 1.1. vb.net 2003.

I am trying to connect to a remote sql server 2000 on a virtual machine
running windows 2000 server. I can connect through the server explorer in
visual studio, but cannot connect through code. I have done it before and
can not do it now; I don''t know what changed. (I also cannot connect to
local Access database through code though I can from server explorer.)

The code is:
conn = New SqlConnection("data source=SERVERNAME;initial
catalog=DATABASE;user id=sa")

Code fails at "conn.open", returning the following error message: "SQL
Server does not exist or access denied."

SQL Server authentication is set to "sqlsever and windows" and, of course,
the "sa" account exists, with no password (though it doesn''t work when I set
a password either).

Please help. I''m really getting desperate, here.


推荐答案

我怀疑它不存在它不存在,它被拒绝了。尝试

查看此 http://www.darkfalz.com/ 1059 创建连接

字符串。所以在VPC会话中,这样你就知道在尝试使用代码之前你已经获得了访问权限




-

Curt Christianson

网站: http://www.darkfalz .com

博客: http://blog.darkfalz。 com


" peshekeedweller"写道:
I''d suspect its not that it doesnt exist, its that you are being denied. Try
looking at this http://www.darkfalz.com/1059 to create the connection
string. So this on the VPC session, that way you know you got your access
correct before you try to do it with code.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"peshekeedweller" wrote:
使用asp.net 1.1。 vb.net 2003.

我正在尝试连接到运行Windows 2000服务器的虚拟机上的远程sql server 2000。我可以通过Visual Studio中的服务器资源管理器进行连接,但无法通过代码连接。我以前做过,现在不能这样做;我不知道发生了什么变化。 (我也无法通过代码连接到本地Access数据库,虽然我可以从服务器资源管理器。)

代码是:
conn = New SqlConnection(" data source = SERVERNAME ;初始
目录= DATABASE;用户id = sa")

代码在conn.open失败,返回以下错误消息:SQL
服务器不存在或访问被拒绝。

SQL Server身份验证设置为sqlsever和windows当然,sa是指sa。帐户存在,没有密码(虽然我设置密码时也无法工作)。

请帮忙。我真的很绝望,在这里。

Using asp.net 1.1. vb.net 2003.

I am trying to connect to a remote sql server 2000 on a virtual machine
running windows 2000 server. I can connect through the server explorer in
visual studio, but cannot connect through code. I have done it before and
can not do it now; I don''t know what changed. (I also cannot connect to
local Access database through code though I can from server explorer.)

The code is:
conn = New SqlConnection("data source=SERVERNAME;initial
catalog=DATABASE;user id=sa")

Code fails at "conn.open", returning the following error message: "SQL
Server does not exist or access denied."

SQL Server authentication is set to "sqlsever and windows" and, of course,
the "sa" account exists, with no password (though it doesn''t work when I set
a password either).

Please help. I''m really getting desperate, here.



Curt,我可以在数据链接向导中创建一个成功的连接;我可以

在Vis Studio Server Explorer中创建一个成功的连接;我可以

在Vis Studio Server Explorer中创建一个成功的服务器。但是没有一个

连接字符串在代码中起作用。甚至尝试使用SQLDataAdapter

组件,并在服务器资源管理器中成功创建连接字符串

在编译和运行时失败。


到底是怎么回事?

" Curt_C [MVP]" < software_at_darkfalz.com>在留言中写道

新闻:D0 ********************************** @ microsof t.com ...
Curt, I can create a successful connection in the data link wizard; I can
create a successful connection in the Vis Studio Server Explorer; I can
create a succesful server in the Vis Studio Server Explorer. But none of the
connection strings work in code. Even trying to use a SQLDataAdapter
component with a connection string created successfully in Server Explorer
fails when compiled and run.

What the heck is going on?
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:D0**********************************@microsof t.com...
我怀疑它并不存在,它被拒绝了。
尝试
看着这个 http://www.darkfalz.com/1059 创建连接
字符串。所以在VPC会话中,你就知道在尝试使用代码之前你已经获得了访问权限。

-
Curt Christianson
网站: http://www.darkfalz.com
博客: http://blog.darkfalz.com

peshekeedweller写道:
I''d suspect its not that it doesnt exist, its that you are being denied.
Try
looking at this http://www.darkfalz.com/1059 to create the connection
string. So this on the VPC session, that way you know you got your access
correct before you try to do it with code.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"peshekeedweller" wrote:
使用asp.net 1.1。 vb.net 2003.

我正在尝试连接到运行Windows 2000服务器的虚拟机上的远程sql server 2000。我可以通过Visual Studio中的服务器资源管理器进行连接,但无法通过代码连接。我以前做过,现在不能这样做;我不知道发生了什么变化。 (我也无法通过代码连接到本地Access数据库,虽然我可以从服务器资源管理器。)

代码是:
conn = New SqlConnection(" data source = SERVERNAME ;初始
目录= DATABASE;用户id = sa")

代码在conn.open失败,返回以下错误消息:SQL
服务器不存在或访问被拒绝。

SQL Server身份验证设置为sqlsever和windows当然,
sa账号存在,没有密码(虽然当我设置密码时它也不起作用)。

请帮忙。我真的很绝望,在这里。

Using asp.net 1.1. vb.net 2003.

I am trying to connect to a remote sql server 2000 on a virtual machine
running windows 2000 server. I can connect through the server explorer in
visual studio, but cannot connect through code. I have done it before and
can not do it now; I don''t know what changed. (I also cannot connect to
local Access database through code though I can from server explorer.)

The code is:
conn = New SqlConnection("data source=SERVERNAME;initial
catalog=DATABASE;user id=sa")

Code fails at "conn.open", returning the following error message: "SQL
Server does not exist or access denied."

SQL Server authentication is set to "sqlsever and windows" and, of
course,
the "sa" account exists, with no password (though it doesn''t work when I
set
a password either).

Please help. I''m really getting desperate, here.





试试:


Data Source = SERVERNAME; Initial Catalog = DATABASE; Persist Security Info = True; User

ID = sa; Password ="


而不是


" data source = SERVERNAME; initial catalog = DATABASE; user id = sa"


虽然为什么你会为sa用户使用空白密码超出我的范围。


Juan T. Llibre

ASP.NET MVP
ASP.NET常见问题解答: http://asp.net.do/faq /

==========================


peshekeedweller <所以***** @ somewhere.com>在消息中写道

news:5n ******************* @ fe10.news.easynews.com。 ..

Try :

"Data Source=SERVERNAME;Initial Catalog=DATABASE;Persist Security Info=True;User
ID=sa;Password="

instead of

"data source=SERVERNAME;initial catalog=DATABASE;user id=sa"

Although why you would use a blank password for the sa user is beyond me.

Juan T. Llibre
ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
==========================

"peshekeedweller" <so*****@somewhere.com> wrote in message
news:5n*******************@fe10.news.easynews.com. ..
Curt,我可以在数据链接向导中创建一个成功的连接;我可以在Vis Studio Server Explorer中创建一个成功的连接;我可以在Vis Studio Server Explorer中创建一个成功的服务器。但是没有一个连接字符串在代码中起作用。在编译和运行时,甚至试图在服务器资源管理器中尝试使用带有成功创建的连接字符串的SQLDataAdapter组件也会失败。

到底发生了什么?

Curt_C [MVP]" < software_at_darkfalz.com>在消息中写道
新闻:D0 ********************************** @ microsof t.com。 ..
Curt, I can create a successful connection in the data link wizard; I can create a
successful connection in the Vis Studio Server Explorer; I can create a succesful server
in the Vis Studio Server Explorer. But none of the connection strings work in code. Even
trying to use a SQLDataAdapter component with a connection string created successfully
in Server Explorer fails when compiled and run.

What the heck is going on?
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:D0**********************************@microsof t.com...
我怀疑它并不存在,它被拒绝了。尝试
查看此 http://www.darkfalz.com/1059创建连接
字符串。所以在VPC会话中,你就知道在尝试使用代码之前你已经获得了访问权限。

-
Curt Christianson
网站: http://www.darkfalz.com
博客: http://blog.darkfalz.com

peshekeedweller写道:
I''d suspect its not that it doesnt exist, its that you are being denied. Try
looking at this http://www.darkfalz.com/1059 to create the connection
string. So this on the VPC session, that way you know you got your access
correct before you try to do it with code.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"peshekeedweller" wrote:
使用asp.net 1.1。 vb.net 2003.

我正在尝试连接到运行Windows 2000服务器的虚拟机上的远程sql server 2000。我可以通过Visual Studio中的服务器资源管理器进行连接,但无法通过代码连接。我以前做过,现在不能这样做;我不知道发生了什么变化。 (我也无法通过代码连接到本地Access数据库,虽然我可以从服务器资源管理器。)

代码是:
conn = New SqlConnection(" data source = SERVERNAME ;初始
目录= DATABASE;用户id = sa")

代码在conn.open失败,返回以下错误消息:SQL
服务器不存在或访问被拒绝。

SQL Server身份验证设置为sqlsever和windows当然,sa是指sa。帐户存在,没有密码(虽然我设置密码时也无法工作)。

请帮忙。我真的很绝望,在这里。
Using asp.net 1.1. vb.net 2003.

I am trying to connect to a remote sql server 2000 on a virtual machine
running windows 2000 server. I can connect through the server explorer in
visual studio, but cannot connect through code. I have done it before and
can not do it now; I don''t know what changed. (I also cannot connect to
local Access database through code though I can from server explorer.)

The code is:
conn = New SqlConnection("data source=SERVERNAME;initial
catalog=DATABASE;user id=sa")

Code fails at "conn.open", returning the following error message: "SQL
Server does not exist or access denied."

SQL Server authentication is set to "sqlsever and windows" and, of course,
the "sa" account exists, with no password (though it doesn''t work when I set
a password either).

Please help. I''m really getting desperate, here.



这篇关于sqlserver连接 - 拼命需要帮助!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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