Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 2nd, 2004, 02:56 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL Server does not exist or access denied.

This is from chapter 3 of the begining asp.net databases book. Can someone please help me? I looked for a forum particular to the book but did not see it.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

this is my connection string
Dim strConnection As String = "server=(MARINERHOME);database=NorthwindCS; " & _
                      "integrated security=true;"

When I test the connection in VS.NET it appears to work
server:MARINERHOME
database: NorthwindCS


 
Old October 3rd, 2004, 03:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi there,

I dont think you need a paranthesis () around the server name there in your connection string.

Check out ConnectionStrings under sql server >> sqlconnection (.Net) or oledbconnection (.Net) whichever fits your case.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old October 3rd, 2004, 07:30 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks we are making progress. I removed the () from the server name and now I get
Login failed for user 'MARINERHOME\ASPNET'.
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: Login failed for user 'MARINERHOME\ASPNET'.

Does this mean that SQLSERVER does'nt know that the connection is trusted under NTAuthority?(am I close here) If so how do I remedy?

Thanks!
Rich


 
Old October 3rd, 2004, 08:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Check out this on MS site.

PRB: "Login Failed" Error Message When You Create a Trusted Data Connection from ASP.NET to SQL Server

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old October 3rd, 2004, 08:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi rich,

So, what is the connection string that you have decided to use?

hmm... looks like you are not using user info in your connection string (ie:) you might be using "Persist Security info=True; Integrated Security=SSPI" so as the ASP.NET pages run using the 'MARINERHOME\ASPNET' account. So you need to give rights for this user to connect to your sql server and it's databases.

On your Sql Server >> Enterprise Manager, give the 'MARINERHOME\ASPNET' user rights to the database.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old October 3rd, 2004, 09:17 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is the connection string I'm using.
Dim strConnection As String = "server=MARINERHOME;database=NorthwindCS; " & _
                      "integrated security=true;"

I'm only running the msde desktop so I don't have enterprise manager. How do I change the rights.

Rich

 
Old October 3rd, 2004, 09:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

I too was not sure about that on MSDE.


Found this on a website.
Quote:
quote:if you are using the Sql Server DesktopEngine MSDE then use the followings:
Granting Access to the ASPNET user

The ASP.NET process runs under the MACHINENAME\ASPNET account. In order for the data access samples to access the database, this user must be granted rights to the sample databases. To manually grant access to the ASPNET user, replace MACHINENAME with the name of your computer, and run the following commands from the command line. Note: The path to the osql.exe command must be located in your PATH environment variable.

osql -E -S (local)\NetSDK -Q "sp_grantlogin 'MACHINENAME\ASPNET'"

osql -E -S (local)\NetSDK -d Pubs -Q "sp_grantdbaccess 'MACHINENAME\ASPNET'"
osql -E -S (local)\NetSDK -d Pubs -Q "sp_addrolemember 'db_owner', 'MACHINENAME\ASPNET'"

osql -E -S (local)\NetSDK -d NorthWind -Q "sp_grantdbaccess 'MACHINENAME\ASPNET'"
osql -E -S (local)\NetSDK -d NorthWind -Q "sp_addrolemember 'db_owner', 'MACHINENAME\ASPNET'"

osql -E -S (local)\NetSDK -d Portal -Q "sp_grantdbaccess 'MACHINENAME\ASPNET'"
osql -E -S (local)\NetSDK -d Portal -Q "sp_addrolemember 'db_owner', 'MACHINENAME\ASPNET'"

osql -E -S (local)\NetSDK -d GrocerToGo -Q "sp_grantdbaccess 'MACHINENAME\ASPNET'"
osql -E -S (local)\NetSDK -d GrocerToGo -Q "sp_addrolemember 'db_owner', 'MACHINENAME\ASPNET'"

OR, search for the location where this "osql" resides on your system and navigate to that path and execute the commands.
Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old October 3rd, 2004, 02:28 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found the file mentioned in the post but upon opening it does not allow any text to be entered.

 
Old October 4th, 2004, 03:21 AM
Friend of Wrox
 
Join Date: May 2003
Location: Delhi, Delhi, India.
Posts: 229
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can also install Enterpirse Manager by installing the SQL Server 2000 Trial version on your client machine as it only installs the client tools such as enterprise manager and query analyzer.

Dont forget to check microsoft Licence agreement

Charul Shukla
 
Old October 4th, 2004, 09:54 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do you know where I can download that. I'm just having a heck of a time with msde.





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server does not exist or access denied happygv SQL Server 2000 0 April 9th, 2008 02:27 AM
SQL Server does not exist or access denied jennypretty Classic ASP Databases 3 May 18th, 2007 11:43 AM
SQL Server does not exist or access denied. jimbeam36 BOOK: ASP.NET Website Programming Problem-Design-Solution 3 November 3rd, 2004 08:51 AM
SQL Server does not exist or access denied haidee_mccaffrey Classic ASP Databases 19 June 28th, 2004 09:38 PM
SQL Server does not exist or access denied. nitinmailbox All Other Wrox Books 1 June 25th, 2003 06:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.