By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,218 Members | 1,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,218 IT Pros & Developers. It's quick & easy.

SQL Server does not exist or access denied.

P: n/a
Hi all,

I'm experiencing a problem using ASP.NET web services to access a
different server with SQL Server 2000 database.
And I get the error of the following

Exception Details: System.Data.SqlClient.SqlException: SQL Server does
not exist or access denied.

[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
WebApplication1.WebForm1.butSearch_Click(Object sender, EventArgs e)
in C:\Inetpub\wwwroot\WebApplication1\search.aspx.vb: 64
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()

here are the details:

It works fine
=============
- connected by SQL Server enterprise manager
- A simple windows form application that has the same code works just
fine
- same source code if web server and database server are in same
machine
Server 1: (database)
====================
server name: database_server
Database: SQL Server 2000
table: ABC
user_id: abc_user
password: abc_password
Server 2: (web server)
======================
web server: Window XP + IIS
IIS Setting: Directory Security -Anonymous access and authentication
control -turn off "Anonymous access"
IIS Setting: Directory Security -Anonymous access and authentication
control -checked "Integrated Windows authentication"
web.config setting: <authentication mode="Windows" />
connection string used in System.Data.SqlClient:
================================================
- connectionStr = "User ID=abc_user;Password=abc_password;Initial
Catalog=ABC;Data Source=database_server;Network Library =dbmssocn"
- not using any impersonation coz i just want to use 'abc_user' to make
the connection to sql server, can I?
- this connectionStr work fine if connecting by vb.net application
I'd found many many posts with similar problem, but still out of luck.

i believe the problem is due to the connection but i had already
specified the user id and password in my connectionStr, so what still
wrong?

Your help is greatly appreciated.

Regards,

Sammy Loo

Jul 24 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I think you have the definitions wrong.

- connectionStr = "User ID=abc_user;Password=abc_password;Initial
Catalog=ABC;Data Source=database_server;Network Library =dbmssocn"
- not using any impersonation coz i just want to use 'abc_user' to make
the connection to sql server, can I?
- this connectionStr work fine if connecting by vb.net application

Server 1: (database)
====================
server name: database_server
Database: SQL Server 2000
table: ABC
user_id: abc_user
password: abc_password

Data Source is the server (you got that correct)
Initial Catalog is the databaseName (like "pubs" or "Northwind")
(you have "ABC" as the table in one place, and ABC as the
databaseName(initial catalog) in another.
If you have a connection string ... impersonation shouldn't have much to do
with that, unless your using trusted.
but since youre coding in your username and password, you're using "sql
authentication".

lastly, the server has to be setup for using "sql authentication", which can
be "turned off" .. (actually, it happens in the sql server install that its
not enabled I think)

check.

www.connectionstrings.com for more samples. be VERY careful with the spaces
in phrases like "intial catalog" and such.
<sa******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi all,

I'm experiencing a problem using ASP.NET web services to access a
different server with SQL Server 2000 database.
And I get the error of the following

Exception Details: System.Data.SqlClient.SqlException: SQL Server does
not exist or access denied.

[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnec
tionString
options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
WebApplication1.WebForm1.butSearch_Click(Object sender, EventArgs e)
in C:\Inetpub\wwwroot\WebApplication1\search.aspx.vb: 64
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()

here are the details:

It works fine
=============
- connected by SQL Server enterprise manager
- A simple windows form application that has the same code works just
fine
- same source code if web server and database server are in same
machine
Server 1: (database)
====================
server name: database_server
Database: SQL Server 2000
table: ABC
user_id: abc_user
password: abc_password
Server 2: (web server)
======================
web server: Window XP + IIS
IIS Setting: Directory Security -Anonymous access and authentication
control -turn off "Anonymous access"
IIS Setting: Directory Security -Anonymous access and authentication
control -checked "Integrated Windows authentication"
web.config setting: <authentication mode="Windows" />
connection string used in System.Data.SqlClient:
================================================
- connectionStr = "User ID=abc_user;Password=abc_password;Initial
Catalog=ABC;Data Source=database_server;Network Library =dbmssocn"
- not using any impersonation coz i just want to use 'abc_user' to make
the connection to sql server, can I?
- this connectionStr work fine if connecting by vb.net application
I'd found many many posts with similar problem, but still out of luck.

i believe the problem is due to the connection but i had already
specified the user id and password in my connectionStr, so what still
wrong?

Your help is greatly appreciated.

Regards,

Sammy Loo

Jul 24 '06 #2

P: n/a
Thanks for you reply.

As you pointed out correctly, 'ABC' is the databaseName, NOT table
>
Data Source is the server (you got that correct)
Initial Catalog is the databaseName (like "pubs" or "Northwind")
(you have "ABC" as the table in one place, and ABC as the
databaseName(initial catalog) in another.
I'd tested this connection by VB.NET and just working fine. So, i
conclude the connectionStr is correct.
>
lastly, the server has to be setup for using "sql authentication", which can
be "turned off" .. (actually, it happens in the sql server install that its
not enabled I think)
however, how can i ensure web server is doing "sql authentication"
correctly? should be configured on web.config or machine.config?

Sammy Loo

Jul 24 '06 #3

P: n/a
Finally, i got it work by changing the connection string

'Incorrect and flow out 'SQL Server does not exist or access
denied.' error
conn_str = "User ID=abc_user;Password=abc_password;Initial
Catalog=ABC;Data Source=database_server;Network Library=dbmssocn;"

'correct and work fine
conn_str = "Server=database_server; Database=ABC; User
Id=abc_user; password=abc_password;"
sloan 寫道:
I think you have the definitions wrong.

- connectionStr = "User ID=abc_user;Password=abc_password;Initial
Catalog=ABC;Data Source=database_server;Network Library =dbmssocn"
Jul 26 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.