473,386 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

SQL Server does not exist or access denied.

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
3 3218
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jay Chan | last post by:
We have just installed a SQL Server 2000 (SP 3A) onto a computer that has Windows-2003 Server on it. Now, we cannot get access to that database server from other computers. Seem like this may be an...
2
by: george r smith | last post by:
Gentlemen, I know that this problem has happened before and I searched and tried all solutions but problem is not solved. I install asp.net community starter kit with some help from this...
6
by: Bob | last post by:
Having trouble getting started. I created an instance of MSDE called VSDOTNET on a computer with the name of sysdev. Using MS SQL Web Adminstrator I created a database called temp with a...
3
by: Matthew Louden | last post by:
I attempt to connect ASP.NET application with SQL Server using ADO.NET. I just open a connection, and it had run-time error in line 34: cn.open(): SQL Server does not exist or access denied....
3
by: Olivogt | last post by:
Hello, I was just puting an application on the web server but it did not work as usual... - I do develop on my notebook and move released applications to the Web server - both have Sql Server...
9
by: Steven Ung | last post by:
Hello all, I'm having the following error dump from an ASP.net application. The program is to calculate MRP and it involves complex queries looping thru hundreds of records in an few SQL 2000...
1
by: ssp | last post by:
G'Day All, I have a web application sitting on my laptop and a Sql Server 2000 database on our INTRANET server running Windows 2003. Up until recently I was able to access the database using my...
2
by: Johan Johansson (Sweden) | last post by:
I can't connect to our database (seperate database server) from within my webservice. I cannot understand why.!!! * I have configured IIS not to allow anonymous access and to use "windows...
1
by: Atia Amin | last post by:
Hi, I am a new member. Hello to every one. I am new in ASP.NET area. I wrote an ASP.NET web application which was running ok with my old laptop. Currently I have given a new laptop. Now I copied...
1
by: vamshika | last post by:
hi, I got a serious Problem. I get "Server does not exist or access denied" with 80004005 as the error code. the win2003 server uses all the latest components(like iis6,jet..etc) and is upto date....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.