Re: SQL Connection Error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You have two things conflicting that are confusing you.

You can connect to SQL using Windows Auth, (through VS.NET). You cannot connect (as you have found) through your Web app. The reason is the web app is running under an account IUSR_YOURSERVERNAME that uses ASPNET account. This account doesn't have permissions to your SQL Server. You can add it and assign it permissions in your database, but I wouldn't recommend this.

I would however recommend creating a new SQL Server user and add it to the database you are connecting to. Then use that username and password in your connection string. You can also test this when using Server Explorer in VS.NET


Clint Hill H3O Software http://www.h3osoftware.com


Sparky Arbuckle wrote:
Thanks for the reply Clint.

I am running this app from my inetpub folder until I am able to upload
it to a web server.  I want to test everything first.  I tried adding
uid and pwd to my connection string and now I am getting the error:

Login failed for user 'UserName'.

.Net SqlClient Data Provider

18456

In VS when I right-click the adapter to preview dataset for this
connection I can view just fine so I know I'm able to connect to this
database.  My windows authentication is what I used to connect to the
SQL server via Enterprise manager and Query Analyzer.  This works
flawlessly.  The only problem is when I try and connect via web app.

Does this make sense or do I need to clarify more?

.



Relevant Pages

  • web authentication into sql server
    ... have a clue about domain security. ... developing a web app that requires windows authentication ... to pull data from sql server. ... sql server and of course any template query will fail. ...
    (microsoft.public.sqlserver.security)
  • Re: ASP.Net with IIS and SQL Server in different hosting companies
    ... Yes, theoretically, you can host SQL Server and your web app far from apart. ... If the communication between the two hosts is via regular internet connection, as you use at home "High-Speed", say, a few Mbp, then your web app would be literally useless. ... The project will basically involve an ASP.Net 2.0 application and a database (ideally MS SQL). ...
    (microsoft.public.dotnet.framework.aspnet)
  • osql Connection
    ... I have SQL 2005 installed and running. ... package that connects to it using Windows Auth and everything works great. ... Problem is I have another 3rd party software that doesn't use Windows auth ... The user has been setup on the SQL Server. ...
    (microsoft.public.sqlserver.connect)
  • Authentication and SQL
    ... Users on 95/IE4.X or W2KPro/IE5.X using a web app on IIS ... basic authentication over ssl, to the SQL server the web ... SQL box, it should be encrypted as well. ...
    (microsoft.public.inetserver.iis.security)
  • is this possible?
    ... 2 sql 2000 servers each in a different location. ... tasked copies some data from access to a local SQL Server database. ... Server database then replicates to the other SQL Server database ... This has been getting us by but new changes to the web app are going to ...
    (microsoft.public.sqlserver.replication)