473,378 Members | 1,378 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,378 software developers and data experts.

ASP.Net Application - SQL Server 2000 Access Problem on Windows 2003 server from XP

I did lot of googling to see if I can solve the SQL server not found
problem while trying to run ASP.Net community starter kit from an XP
machine to Windows 2003 server hosting SQL server 2000 database. Tried
all possible combinations but it still fails.

I have Windows 2003 server having SQL Server 2000 installed with SP2.
The installation went Ok on a XP professional machine and I was able
to create database and user logins etc on Windows 2003 server through
installation.

If I use this site from Windows 2003 server itself then there is no
problem. I am sure that this is access problem and I tried all
possible combinations but this does not work.

The installation created domain\ASPNET account in SQL server. The SQL
server accepts both windows and SQL server authentication. The
connection string uses 'sa' account and I am able to connect using
this account through server explorer in VS, query analyzer and
Enterprize manager but it fails when I bring up the site.

My questions:

1. The local machine (Win XP pro) hosting this site is using
localmachine\ASPNET account and this works if I connect to a SQL
server on Windows 2000 server but it fails if SQL server is in Windows
2003. What is different in Windows 2003 that I need to do to make it
work. I even granted administrator privilege to domain\ASPNET account
but that did not help. I changed machine.config also to make
impersonate=true and user=domain\ASPNET but that also did not work. I
made sure that site has security rights on domain\ASPNET account.

2. Even if Impersonate=true would have worked, I was not going to use
this approach as it will fail my other sites connecting to other SQL
server and Oracle. What am I missing here?

3. If I try to grant access to localmachine\ASPNET to SQL server
through Enterprize manager then I get error.

-- This works if I do for domain\ASPNET
use MASTER
go

exec sp_revokedbaccess 'ASPNET'
exec sp_revokelogin 'domain\ASPNET'
go

use communitystarterkit
go

exec sp_revokedbaccess 'ASPNET'
exec sp_revokelogin 'domain\ASPNET'
exec sp_grantlogin 'domain\ASPNET'
exec sp_defaultdb 'domain\ASPNET','communitystarterkit'
exec sp_grantdbaccess 'domain\ASPNET', 'ASPNET'
exec sp_addrolemember 'db_owner', 'ASPNET'
go

-- This fails if I do it for localmachine\ASPNET
exec sp_grantlogin 'localmachine\ASPNET'
The error is
Windows NT user or group 'localmachine\ASPNET' not found. Check the
name again. The enterprize manager's dialog box shows the account but
SQL server command fails.

If you have configured ASP.net from Windows XP to SQL server running
on Windows 2003, please let me know if I am missing anything.

Thanks for your help.
Nov 18 '05 #1
2 3168
bk
Vikram
I think you might be the preson who can take me out of my missery. I
have been going crazy with a problem similar to yours. I have been
googling like mad but with no luck until I came across your posting. I
get "SQL Server is unavailable or does not
exist" error while developing asp.net application in vs2003's IDE
development mode. The sql2000 is installed on a windows 2003 server. I
am able to connect to server using Query Analyzer and Enterprise
Manager. My connection string is:

string sConStr= "Server = 192.168.0.28;User ID=myuser;Initial
Catalog=pubs;Password=mypassword"

I use the same connection string succesfully connecting to a windows
2000 server with sql2000 with exactly the same database.

My development machine is a XP with SP2. My server machine is a member
of a domain which I have no control.

I have not yet applied your solution but I can not understand why it
should be necessary to go through such complex steps to solve a problem
arising from simple use of standard Microsoft tools and components.


Vaap wrote:
This was a very tough problem to solve and I am posting my results so
that others might benefit from it. The issue is with accessing SQL
server on Windows 2003 from another machine through ASP.Net.

After lot of reading and googling, I found following steps and I do
not understand fully well their rationale but the end result is - it
worked.

If SQL Server is installed on Windows 2003 server and you are
attempting to access this through ASP.Net from a remote machine then
there are problems in remote access.

The domain should have domain\ASPNET account and it should have a
strong password. On you local machine, modify ASPNET password to
strong password say admin123. The password on both machines should be
same.

Go to IIS console Directory>Security>Edit on your virtual directory.
Check annonymous access and specify user name and password as ASPNET
and password as admin123. Make sure that the "Allow IIS to control
password" is unchecked. Integrated Windows Authentication should be
checked for debugging the application.

Go to SQL Server Enterprize manager console.

Add account domain\Administrator and make sure that it has System
Administrator Server role assigned. Otherwise SQL Agent will not
start.

Add account domain\ASPNET and allow access to your database and grant
db_owner (??)

Go to your web.config and add a line <identity impersonate="true" />
immediately after <authentication> tag.

The connection string has sql server login say 'sa' and SQL server was in mixed mode of authentication.

After above, the connection to SQL Server should work. There might be
some other way but this worked for me after lot of combinations. I did not want to change machine.config as it affects other applications.
The other posts suggested granting "system" privilege or "as a part of operating system" to ASPNET account but it did not work for me and
changing machine.config for impersonating the use account.


Nov 19 '05 #2
might be the prob with SP2's firewall feature. try to re-configure the
firewall to allow any traffics from/to sql server.
rgds,

"bk" <b.******@uea.ac.uk> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Vikram
I think you might be the preson who can take me out of my missery. I
have been going crazy with a problem similar to yours. I have been
googling like mad but with no luck until I came across your posting. I
get "SQL Server is unavailable or does not
exist" error while developing asp.net application in vs2003's IDE
development mode. The sql2000 is installed on a windows 2003 server. I
am able to connect to server using Query Analyzer and Enterprise
Manager. My connection string is:

string sConStr= "Server = 192.168.0.28;User ID=myuser;Initial
Catalog=pubs;Password=mypassword"

I use the same connection string succesfully connecting to a windows
2000 server with sql2000 with exactly the same database.

My development machine is a XP with SP2. My server machine is a member
of a domain which I have no control.

I have not yet applied your solution but I can not understand why it
should be necessary to go through such complex steps to solve a problem
arising from simple use of standard Microsoft tools and components.


Vaap wrote:
This was a very tough problem to solve and I am posting my results so
that others might benefit from it. The issue is with accessing SQL
server on Windows 2003 from another machine through ASP.Net.

After lot of reading and googling, I found following steps and I do
not understand fully well their rationale but the end result is - it
worked.

If SQL Server is installed on Windows 2003 server and you are
attempting to access this through ASP.Net from a remote machine then
there are problems in remote access.

The domain should have domain\ASPNET account and it should have a
strong password. On you local machine, modify ASPNET password to
strong password say admin123. The password on both machines should be
same.

Go to IIS console Directory>Security>Edit on your virtual directory.
Check annonymous access and specify user name and password as ASPNET
and password as admin123. Make sure that the "Allow IIS to control
password" is unchecked. Integrated Windows Authentication should be
checked for debugging the application.

Go to SQL Server Enterprize manager console.

Add account domain\Administrator and make sure that it has System
Administrator Server role assigned. Otherwise SQL Agent will not
start.

Add account domain\ASPNET and allow access to your database and grant
db_owner (??)

Go to your web.config and add a line <identity impersonate="true" />
immediately after <authentication> tag.

The connection string has sql server login say 'sa' and SQL server

was
in mixed mode of authentication.

After above, the connection to SQL Server should work. There might be
some other way but this worked for me after lot of combinations. I

did
not want to change machine.config as it affects other applications.
The other posts suggested granting "system" privilege or "as a part

of
operating system" to ASPNET account but it did not work for me and
changing machine.config for impersonating the use account.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
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: FrodoBaggins | last post by:
Dear Team, I am running Visual Studio 2003 Version 7.1.3088 on Windows Server 2003. I have written a C# application that must write to the event log. When it attempts to write to the event log,...
2
by: Petr PALAS | last post by:
Hi, when I open ANY ASP.NET application on my computer I get this message: ---------------------------------------------------------------------------- ---- Server Application Unavailable ...
5
by: Ken Cox [Microsoft MVP] | last post by:
MS has posted this here: http://www.asp.net/faq/ms03-32-issue.aspx Fix for: 'Server Application Unavailable' Error after Applying Security Update for IE...
1
by: Reza Sadeghi | last post by:
Hi I am getting this error when I tried to browse any asp.net in visual studio.net. I can build the project but when I try to run and debug the project I get error message that "Unable to start...
22
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one...
4
by: casper | last post by:
Hi, I created an asp.net 2.0 website with VWD and made it an application in IIS. It was created on a ntfs disc (my documents...). The directory permissions are set on 'anonymous allowed' using...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.