Problem with database connection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I am getting an Error : Sql server does not exist or access denied when i try to connect through a web application. The same connection string works for a windows application. The same webapplication works fine if i try to run on the SQL server macines itself. I am using SQL Server2000.

(I can access the server database through enterprise manager.)

Thanks in advance.
 
Sounds like a permissions issue. A Windows application generally runs under
the local System account.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

KKR said:
Hi

I am getting an Error : Sql server does not exist or access denied when i
try to connect through a web application. The same connection string works
for a windows application. The same webapplication works fine if i try to
run on the SQL server macines itself. I am using SQL Server2000.
 
KKR

Are you using Integrated Security=SSPI in your connection string? I am assuming so, since you have no problems connecting via your Windows app (which will use your credentials while trying to access SQL Server). Through the Web server, SQL Server most likely sees you as IUSR_machinename, or ASPNET, depending on your settings. If you are trying to access with Integrated security from the Web server, you have to take a few measures

1.) turn on Integrated Windows authentication in II
2.) In the web.config file, make sure you have <authentication mode="Windows"/>. Add the <identity impersonate="true"/> element right in the same area

What this is doing is flowing your credentials down to SQL Server. This should be good to go for you.
 
Back
Top