Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 SQL Server does not exist or access denied

Author  Topic 

Nim
Starting Member

2 Posts

Posted - 2004-08-22 : 05:50:25
Hi..
I'm a newbie at SQL and would appreciate anyone's help with this.

I've set up MS SQL 2000 on Win XP(Pro).When I log into the system using my account and try to access the sql server through my webpg, I get the following error - SQL Server does not exist or access denied. I have attached the details below.

My system is the server and I'm using IIS to run the webpg. MS SQL was installed with 'mixed' authentication and my account id was also added into Security/Login. And there are no probs connecting to the database in Enterprise Manager.Could there be any configuration problem?

warmest regards,
Nim

Details:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

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

Source Error:

Line 31: SqlCommand objCommand = new SqlCommand(strSQL,objConnection);
Line 32:
Line 33: objConnection.Open();
Line 34: dgNamelist.DataSource= objCommand.ExecuteReader();
Line 35: dgNamelist.DataBind();


Source File: D:\finalFYP\webroot\SQLServer_connection.aspx Line: 33

Stack Trace:

[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +484
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
ASP.SQLServer_connection_aspx.Page_Load(Object sender, EventArgs e) in D:\finalFYP\webroot\SQLServer_connection.aspx:33
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731


timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-08-22 : 07:12:06
Where's your connection string?
Go to Top of Page

Nim
Starting Member

2 Posts

Posted - 2004-08-22 : 07:37:28
Connection string -
String strConnection = "server=(local)\\NetSDK;database=Northwind; integrated security=true;";

I have a feeling that I haven't configured my server properly.

Should I use any service related to mssql under Administrative Tools/Services in any way?like how 'MSSQL$NetSDK' is for MSDE.
Go to Top of Page

adharjain
Starting Member

1 Post

Posted - 2004-08-27 : 03:35:19
Hi

Even i have similar kind of a problem. I am working in a company. I have two database servers(Quantum and VTripathi). If i use Quantum, I apply

"Server=quantum;Database=quantumagency2;User id=sa;Password=;"

and to use VTripathi

"server = VTripathi;user id = sa;password=Quantum; database = ASP_DEVOPS_QA"

but problem is, It works fine when i use vtripathi server but when i use Quantum as my server, i get the same error viz.


SQL Server does not exist or access denied.

Line 18: lstrConn = System.Configuration.ConfigurationSettings.AppSettings.Get("ConnStr");
Line 19: connObj = new SqlConnection(lstrConn);
Line 20: connObj.Open();
Line 21: /*try
Line 22: {

Stack Trace

[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +484
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
EbxDv05.ConnDB..ctor() in c:\inetpub\wwwroot\ebxdv05\conndb.cs:20
EbxDv03.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\ebxdv05\webform1.aspx.cs:70
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731


Please mail me the solution ... adharjain@hotmail.com
Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2004-08-27 : 05:12:58
Tried adding the IIS service account to your SQL logins?

-------
Moo. :)
Go to Top of Page

vnasibi
Starting Member

17 Posts

Posted - 2004-09-07 : 18:19:58
I also have the same problem.
All last week plus the better part of this morning, my application could open the database with no errors. Now after restarting my machine, I keep getting a server error that SQL Server does not exist.
Pasted below is the error page. Please help...

Server Error in '/ISHelpDeskv1' Application.
--------------------------------------------------------------------------------

SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

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

Source Error:


Line 153:
Line 154: 'Fill the dataset
Line 155: SqlDataAdapter1.Fill(DsProjects1)
Line 156:
Line 157: 'Update the datagrid


Source File: c:\inetpub\wwwroot\ISHelpDeskv1\Summary.aspx.vb Line: 155

Stack Trace:


[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(Object 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)
ISHelpDeskv1.Summary.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\ISHelpDeskv1\Summary.aspx.vb:155
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-07 : 18:22:57
Do you have a firewall in between the web server and the database server? If so, have you punched a hole in the firewall for the port that SQL Server is using? If so, then are you referring to this port in your connection string? If not, did you create an alias on the web server? An alias can be created using Client Network Utility if you have SQL Client Tools installed on the web server or you can manually add a string value to the registry. I've posted how to do this several times in the forums, so just search for it.

Tara
Go to Top of Page

vnasibi
Starting Member

17 Posts

Posted - 2004-09-07 : 18:30:05
Hi Tara
The SQL Server database is local to my machine, so the firewall should not be an issue since that's on the network.
I will search on creating an alias on the web server and let you know if I was successful.
Thanks much

If you can't make it good, make it look good!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-07 : 18:31:16
Is the web server local to your machine too? If so, is the MSSQLSERVER service even started?

Tara
Go to Top of Page

vnasibi
Starting Member

17 Posts

Posted - 2004-09-07 : 18:36:24
Yes, the web server is local...(I believe) I am the only person who has Visual Studio .NET running in this place, so everything is local.
SQL Server is set to Auto Start on logon in my machine.


If you can't make it good, make it look good!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-07 : 18:37:42
Just because it is auto start doesn't mean that it is started right now. It could have stopped. Please check the services applet in Admin Tools in Control Panel to verify. The name that you have specified in the connection string, can you ping it?

Tara
Go to Top of Page

vnasibi
Starting Member

17 Posts

Posted - 2004-09-07 : 19:09:57
I checked...MSSQLSERVER is started, but ASP.NET is not, and I cannot start the service, I get error message: Error: 0x8007277a.
Could this be a part of the problem?

If you can't make it good, make it look good!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-07 : 19:14:40
Are you able to connect to SQL Server using Entperise Manager or Query Analyzer?

Tara
Go to Top of Page

vnasibi
Starting Member

17 Posts

Posted - 2004-09-07 : 19:23:52
Yes ... I can do both...

If you can't make it good, make it look good!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-07 : 19:27:12
Please post the connection string then.

Tara
Go to Top of Page

vnasibi
Starting Member

17 Posts

Posted - 2004-09-07 : 19:38:16
What's your email so that I could do screenshots and email you everything? I also noticed that everytime I restart my app, when I check the server the explorer, the connection to the db is broken and needs to be refreshed. Although this doesn't fix the problem either...so frustrating!!

If you can't make it good, make it look good!
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-09-07 : 23:37:13
try a simple module first of establishing a connection from you app to the server.

if it's still a 'server does not exist error' then you may want to check your connection string, something might be missing.

try adding 'security context=sspi' in your conn string

hope this might helps...
Go to Top of Page

Pace
Constraint Violating Yak Guru

264 Posts

Posted - 2004-09-08 : 06:54:15
If you have named your machine then "local" will not work... It will be "machinename" instead of local...
Go to Top of Page

vnasibi
Starting Member

17 Posts

Posted - 2004-09-08 : 13:21:17
Hey Tara
Here's the conn string:
workstation id="VNASIBI-3RJ2051";packet size=4096;integrated security=SSPI;data source="VNASIBI-3RJ2051";persist security info=False;initial catalog=NewProjects

I created a new SQl DB (newprojects) and a new ASP app, and I'm still getting this error message

If you can't make it good, make it look good!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-08 : 13:39:08
So is this the name of your machine: VNASIBI-3RJ2051? Is that the name that you are using when you connect to SQL Server via Query Analyzer or Enterprise Manager? Is NewProjects the name of the database?

Tara
Go to Top of Page

vnasibi
Starting Member

17 Posts

Posted - 2004-09-08 : 14:07:05
Hi
Yes, my machine name is VNASIBI-3RJ2051.
In my Enterprise Manager, I get two options, Local and production. Same as Query Analyzer. However, on the network, others see my system name. I also tried to open the webpage on another network machine by typing http://VNASIBI-3RJ2051/NewProjects/Webform1.aspx, I got an error message that it cannot be accessed remotely because of "I think" network security

If you can't make it good, make it look good!
Go to Top of Page
    Next Page

- Advertisement -