Re: Weird ODBC Behavior on IIS server

From: Tom Kaminski [MVP] ((A_at_T))
Date: 11/08/04


Date: Mon, 8 Nov 2004 08:10:05 -0500


"timperkins" <timperkins@discussions.microsoft.com> wrote in message
news:6C4BBD1C-4A83-4201-A9FA-5E06F28103A1@microsoft.com...
> I've just upgraded our Intranet Server to Windows 2003 and IIS 6. The
> site
> uses basic authentication and connects to a SQL Server and Oracle
> databases
> using ODBC connections on the IIS host... We're using classic ASP to
> display
> the database data.
>
> Our ASP pages appear to be connecting to the database using the users
> credentials, rather than the credentials in the ODBC DSN connection.
> Here's
> a code snippet:
>
> <%
> strSQL = "select distinct vchParameterDesc from Onyx..SDtcSalesRegion
> where
> chOSAssignedTo = '" + strNTUser + "'"
>
> Set objConnection = Server.CreateObject("ADODB.Connection")
> objConnection.Open "EDA"
>
> Set ResultSet = objConnection.Execute(strSQL)
> %>
>
> The page fails on the "objConnection.Open EDA" line, reporting:
>
> [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
> 'MYDOMAIN\username'.
>
> The ODBC connection on the IIS server has the "With SQL Server
> authentication using a login ID and password entered by the user" option
> checked. I then entered a Login ID and password on the tab" This worked
> just fine in IIS 5.0 and Windows 2000 server... Why is the page trying to
> connect to the database with the users credentials, rather than those that
> I've defined in the ODBC connection?

Are you connecting to Oracle or SQL Server?

Why not use a DSN-less connection?
http://www.aspfaq.com/show.asp?id=2126

-- 
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserver2003/community/centers/iis/
http://mvp.support.microsoft.com/
http://www.iisfaq.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://www.tryiis.com 


Relevant Pages

  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... Create a Connection object and pass in a ConnectionString to ... manage the database table you reference. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: (Newbie)Application Roles
    ... level: the database itself. ... SQL Server accommodates these needs through the use of application ... the user's connection through a specific application. ... the connection permanently loses all permissions applied to ...
    (microsoft.public.sqlserver.security)
  • Re: Help! Set up Windows Group to access application
    ... The connection string for a trusted connection is: ... --add login as database user ... SQL Server MVP ... If you have troubles with finding your ways in Crystal Reports, ...
    (microsoft.public.sqlserver.security)
  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Visual Studio but not to VS 2003. ... Create a Connection object and pass in a ConnectionString to address ... manage the database table you reference. ... Yep, my latest book can help too, but mostly if you're targeting SQL Server ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: Logging in in background
    ... wold take all kinds of modifictions as I'd need to be checking that each SQL ... my database and all have connection strings associated with them. ... I suspect that there is also an issue on the SQL Server side as I keep ...
    (microsoft.public.access.modulesdaovba)