Re: Cached Logon

From: Roland Hall (nobody_at_nowhere)
Date: 12/22/04

  • Next message: Ken Schaefer: "Re: Cached Logon"
    Date: Tue, 21 Dec 2004 22:05:47 -0600
    
    

    "Ken Schaefer" <kenREMOVE@THISadopenstatic.com> wrote in message
    news:uBfCwRi5EHA.3756@TK2MSFTNGP14.phx.gbl...
    : Hi,
    :
    : Your browser is caching the credentials, and resending them for each
    : subsequent page request to that server (until the browser is closed).

    The cache was cleared and the browser was closed and still it failed but I
    was prompted each time for credentials but only for the first page.

    : IE
    : will continue sending those credentials as long as they work. As far as IE
    : is concerned, the credentials work, even for the first page, as the page
    can
    : be accessed (it's just the ASP page -> SQL Server that doesn't work, but
    IE
    : doesn't know anything about logging into databases)

    I know IE is not logging into the database. The logon to the PUBS database
    using sa was failing, but the password was correct and the other two files
    worked.

    : In terms of the login failure - can we see the exact error message that
    you
    : are seeing please?

    Error Type:
    Microsoft OLE DB Provider for SQL Server (0x80040E4D)
    Login failed for user 'sa'.
    /msft/StraightASP.asp, line 7

    Here's the whole file. It's not my code. It belongs to MSFT. (password
    removed)

    <%@ Language=VBScript %>
    <%
    Function GetRecordset()
     Dim cnn
     Set cnn = CreateObject("ADODB.Connection")
     cnn.Open "Provider=SQLOLEDB.1;Initial Catalog=PUBS;Data Source=localhost",
    "sa", ""
     Set GetRecordset = cnn.Execute("select * from authors")
    End Function
    %>

    <html>
    <head>
    <title>Straight ASP Approach</title>
    <link rel="style***" type="text/css" href="default.css">
    </head>
    <body>

    <h1>Authors</h1>

    <table cellpadding="3" cellspacing="0">
     <tr>
      <th>SSN</th>
      <th>Last Name</th>
      <th>First Name</th>
      <th>Phone</th>
     </tr>
     <%
      Dim rs
      Set rs = GetRecordset()
      do While Not rs.EOF
     %>
       <tr>
        <td><%=rs("au_id")%></td>
        <td><%=rs("au_lname")%></td>
        <td><%=rs("au_fname")%></td>
        <td><%=rs("phone")%></td>
       </tr>
     <%
      rs.MoveNext
      loop
      rs.Close
      Set rs = Nothing
     %>
    </table>
    </body>
    </html>

    : Also, are you using a common connection string across all three pages (eg
    is
    : the connection string stored in an include file, or in the registry?)

    Within the file itself. No include. No reg. See above.

    : Or
    : have you hard coded the connection string into all three pages?

    Yes, MSFT did.

    : If the
    : latter, then I would suggest moving the connection string to a central
    : include file (or application variable), and using that on all three pages
    to
    : ensure that you aren't getting a dud connection string on one of the
    pages.

    I copied the connection from StraightXML1.asp and pasted it over the one in
    StraightASP.asp. Same issue.

    I'm not new to this stuff. I experienced something out of the norm and was
    wondering if anyone else has also experienced this.

    Here is the code from StraightXML1.asp: (password removed)

    <%@ Language=VBScript %>
    <!-- #INCLUDE FILE="inc/xmlutil.asp" -->

    <%
    Function GetRecordset()
     Dim cnn
     Set cnn = CreateObject("ADODB.Connection")
     cnn.Open "Provider=SQLOLEDB.1;Initial Catalog=PUBS;Data Source=localhost",
    "sa", ""
     Set GetRecordset = cnn.Execute("select * from authors")
    End Function
    %>

    <html>
    <head>
    <title>Straight XML Approach</title>
    <link rel="style***" type="text/css" href="default.css">
    </head>
    <body>
    <% = TransformXML( RecordsetToXMLDoc(GetRecordset(), "author"),
    "xsl/authors.xsl" ) %>
    </body>
    </html>

    Everything came from here:
    http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/1100/beyondasp/toc.asp

    -- 
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but 
    without any warranty; without even the implied warranty of merchantability 
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    

  • Next message: Ken Schaefer: "Re: Cached Logon"