Sunday, March 25, 2012

asp, trusted authentication, sql server 2000

hi...

i'm trying to write a database application using asp (not .net) and need to have it connect to SQL server 2000 using windows integrated security and trusted authentication. i have the following asp code:

DIM dbConn
set dbConn = Server.CreateObject("ADODB.Connection")
DBconn.Open "Driver={SQL Server};Server=DBSERVER;Database=MyDatabase;Truste d_Connection=yes"

i can access the page from the local webserver (http://localhost/sample.asp) but cannot access it from another machine. when i access it via another machine, it prompts for a un/pw but still says:

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

please help...thanksHowdy,

Try setting up an ODBC connection ( make it use NT authentication ) on the web box to the SQL box and see if the problem goes away.

That may help establish where the problem is. Also, do you have same version of MDAC on web server & SQL Server boxes?

Cheers,

SG.|||i do have an odbc connection to the sql database on the web box (which currently is an xp pro machine for testing purposes, once i finish it will be moved to a 2000 server box)...how do i get it to use that specific connection?|||Try the following connection string:

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=mydatabase;Data Source=dbserver

Also, your iis configuration may not be correct.|||After a good deal of troubleshooting, I have reason to believe that my IIS server is at fault. I do not know how to configure it correctly to use integrated security. I thought I had it correct - I do not allow Anonymous access, and under Authenticated access I have:

Digest authentication for Windows domain servers is checked (I've tried not using this, and recieved the same result)

Basic authentication (password is sent in clear text) is NOT checked

Integrated Windows authentication is checked.

When logging onto the ASP page, it does prompt for a user name and password. Upon entering my AD logon/password (which does have permission on the database), it errors out, reporting Login failed for user (null). This error is the same as it appears in SQL server's logs.

I can access it directly from the server without incident. Also, if i *do* allow anonymous access and use my credentials (as opposed to IUSER_blah), I can access it successfully. Otherwise, it reports the aforementioned error.

It might be mentioned that the machine I've been using to try to access the page is on XYZ domain, as is the IIS server - however, the SQL server is in the ABC domain. Does this matter?

No comments:

Post a Comment