Despite Server authentication/password I get different results if webpage is authenticated or anonymous

  • I have an anonymous (remote_user=blank) web ASP page (Win2000 w/IIS) connecting to a MS SQL 2000 server over the intranet.  I am using uid and password. Everything works....Network, IIS talking to MS SQL server, etc.

    Now if I change the SAME web page to authenticate (remote_user= my network ID) and try to connect to the same MS SQL server I get an error now

    ERROR:

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC SQL Server Driver][Named Pipes]SQL Server does not exist or access denied.

    QUESTION:

    Since I am trying to connect via UID and password why would authentication make a difference?

    MY CODE which works when anonymous is:

     CONST gstrProvider    = "MSDatashape"

        CONST gstrDefaultOpenConn = "data provider=SQLOLEdb;driver={SQL Server};server=rsica;uid=MyWeb_PublicUser;pwd=Password;database=MyWeb"

      SET objCmd    = Server.CreateObject("ADODB.Command")

      objCmd.CommandText  = "dbo.GetUserInfo"

      objCmd.CommandType  = adCmdStoredProc

      objCmd.ActiveConnection = gstrDefaultOpenConn  <---ERROR line when Authenticated

    Any Help would be greatly appreciated!

  • My guess is that setting the web page to windows authentication means the CONST definition is ignored. The page tries to connect using Windows authentication and your Windows login is not recognised by the SQL Server or database.

    You could confirm this by trying to connect from the web server via isql using Windows authentication (/E parameter) or by using SQL Profiler to monitor your attempts to connect from the web page (look at the NTUserName and LoginName columns). 

     

  • When you authenticate, then your asp pages run under the windows user id with which you authenticated, and presumably you have properly set up this user id as a database user in the db in question and hvae a corresponding login.

    When you run 'anonymous' you are really running under a userid 'IUSR_xxxx' Where xxxx is the machine name of the asp server. (that windows userid is set up during IIS installation, normally). So you have changed Windows userids and you may need to match your windows userid to your sql server login.

    I know that doesn't exactly answer the question.. why does uid and pwd not suffice? I don't know that part, either.

     

  • Following on from PhilM99's answer. It sounds like the windows userid you authenticate with does not have access to the server (rsica) across the network. Check your windows security settings.

    Peter

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply