473,395 Members | 1,891 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,395 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 3220
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: 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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

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.