Link to home
Start Free TrialLog in
Avatar of eelgueta
eelguetaFlag for Chile

asked on

Authentication pop-up with large response (IIS 6.0/Win2003)

Hi All,

I have a simple ASP app that request some filter parameters and performs a database query with them, returning a HTML table filled with the retrieved data.

In IIS 5.0 (Win2000) everything worked ok. After I copied these scripts to IIS 6.0 (Win2003) when I request the whole data set (3,409 records) I get an authentication pop-up. If I request fewer records (1,000, for instance) the page works ok. In IIS 5.0 the page works no matter the response size (partial or full).

The page with the full resultset is 2138.85 KB.

TIA,

Ed.
Avatar of fritz_the_blank
fritz_the_blank
Flag of United States of America image

What may be happening is that your script is timing out.

1) Set a longer time out on your connection object
2) Set an explicit script timeout on your page


1)

dim strDataPath, objConnection
strDataPath = SErver.MapPath("YourDatabase.mdb")
set objConnection=Server.CreateObject("ADODB.Connection")
strConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;"_
       + " Data Source= " & strDataPath & ";"_
       + " Mode=Share Deny None;User Id=admin;PASSWORD=;"

objConnection.ConnectionTimeout = 15      '<----------------------------------------------------this value
objConnection.CommandTimeout =  10     '<----------------------------------------------------this value
objConnection.Mode = 3 'adModeReadWrite
if objConnection.state = 0 then
  objConnection.Open strConnectString
end if


2) place this at the top of your page (value in milliseconds):

Server.ScriptTimeout = 2500


FtB
Avatar of eelgueta

ASKER

FtB,

Thank you for your answer, but that's no the problem. In fact, the authentication window pops up almost instantaneously.

Anyway, I applied your recommendation, but nothing changed.

BTW, the db server is MS SQL Server 2000, and I'm using a DSN.

Ed.
I forgot to mention the db server is in another machine, so I'm including a fixed user name and password in the connection string:

   set con = server.createobject("ADODB.connection")      
   con.Mode = 3
   con.ConnectionTimeout = 15
   con.CommandTimeout =  10
   con.Open "DSN=mydsn;User Id=test;Password=test;"

I found out the authentication pop-up appears only with more than 1,102 records. This works:

  Do Until rs.EOF or cnt = 1102

This doesn't worK:

  Do Until rs.EOF or cnt = 1103

My loop is like this:

  cnt = 0
  Do Until rs.EOF or cuenta = 1102
    :
    :
    rs.MoveNext
    cnt = cnt + 1
  Loop
That is truly strange....

I suppose if you have the databse locally, it works fine? I wonder if the authentication challenge comes from SQL Server or from the remote server.

FtB
Eureka!!!

Adding buffering everything works Ok:

<%
Response.Buffer = True

  cnt = 0
  Do Until rs.EOF or cuenta = 1102
    :
    :
    rs.MoveNext
    cnt = cnt + 1
    if cnt mod 1000 = 0 then
      Response.Flush
    end if
  Loop

Response.End
%>
I never thought of that--I have response.buffer=true on every one of my pages!

FtB
That's fine with me. And since I was the only one posting here, this question is ready to go.

FtB
ASKER CERTIFIED SOLUTION
Avatar of PAQ_Man
PAQ_Man
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial