perplexing SQL authentication from ASP.net issue

From: Robert Brown (robert.n.brown@treasury.sungard.com)
Date: 09/13/02


From: robert.n.brown@treasury.sungard.com (Robert Brown)
Date: 13 Sep 2002 05:16:14 -0700


Hi all,

Apologies for the cross-post, I cant really tell what's the issue
here...

I'm developing an asp.net intranet application using VS.net. The IIS
directory security is set to Integrated Windows Authentication only.
The dataserver (MS SQL 7) is on a separate machine to the IIS server,
but in the same domain. MS SQL is set to accept both Windows and SQL
authentication. I'm trying to use Windows authentication.

My NT user ID has permission on the database.

The problem is, when my asp.net app attempts to log into the database
I get the following error:

Login failed for user '(null)'. Reason: Not associated with a trusted
SQL Server connection.

I've tried a variety of connection strings. I keep the connection
string in the Web.config file. I started out using the same
connection string that VS.net uses. I ripped it out of a
sqlConnection object:

data source=xxx212;initial catalog=Test;integrated
security=SSPI;persist security info=False;workstation id=xxx210;packet
size=4096

I'm able to connect fine from VS.Net (which is installed on the web
server) using this string.

I then built a connection string from a blank .udl file:

Integrated Security=SSPI;Persist Security Info=False;Initial
Catalog=Test;Data Source=xxx212

Still no go. I added a Trusted_Connection=yes. No good.
Trusted_Connection=true. No good.

I know that it should work because I have a classic asp page that
works perfectly:
--------------------------------------------------
dim dbc
Set dbc = Server.CreateObject("ADODB.Connection")

dbc.Open("DSN=QuantumSQL;SERVER=xxx212;DATABASE=Test;")
--------------------------------------------------

I have this page in the same directory as my ASP.net. Connects to the
same dataserver with no problem. I tried this connection in my
ASP.net app, but I got another message:

Unknown connection option in connection string: dsn.

...which I haven't pursued.

When I run my old asp server variables page, I can see that AUTH_USER
is my NT DOMAIN\uid, and AUTH_TYPE is Negotiate.

Can anyone please help out on this? Much appreciated....

Thanks,

Rob



Relevant Pages

  • Re: Web and SQL Security
    ... Your connection string needs to be a low privileged account. ... SQL auth is never recommended, ... Therefore web app communicates with the SQL server using ...
    (microsoft.public.sqlserver.security)
  • Re: help with changing some code from mdb to adp
    ... At the end of this post is an example of an ADO connection string to a SQL ... Server database, and '' to the UNC path/name of your instance of SQL ... Windows, you can't create a new UDL file directly, but you can create a new, ...
    (microsoft.public.access.adp.sqlserver)
  • how to configure ms sql server 2k and windows server 2k in order to sql from remote computer (with v
    ... My local database (under ms sql server 2000, ... database using a connection string with the ADODB VB object. ...
    (microsoft.public.sqlserver.connect)
  • Re: Pass Through Query Question
    ... "Joe Williams" wrote in message ... > when you mentioned setting the connection string in the properties of the ... It runs with no problem using SQL query anlayzer. ...
    (microsoft.public.access.queries)
  • Re: Cant get SQL INSERT code to work
    ... I'm not sure you can use SQL to add data to an Excel file from another ... From Access Help file (covers JET SQL): ... ' Create the connection string. ... > 'Excel file and modify the SQL statement to fit your data. ...
    (microsoft.public.access.queries)