Session Timeout when trying to read database

H

HolaGoogle

hi all,
can you please tell me what i should do to avoid session timeout when
displaying my database info in my asp form
(DisplayUserDatabase.asp)???
** actualy it does load and display the database randomly....otherwise
it's always runs into a session time out....
**Also when i save new account info (You'll notice that i've been
asked to put a save button near each record...so, it's not one global
save it's by record), i'd like to be able to save only the changed
record and nothing else. The way i do it now works, but i've to reload
to whole page and get the same timeout error!!! is there anyway to
change this??? After saving my DB info i redirect the user to the
former form (DisplayUserDatabase.asp). Maybe it's because i'm using 2
forms: one for displaying DB info(DisplayUserDatabase.asp) and another
one for saving new info(SaveUserAccount.asp)...but otherwise i don't
see how i can make this work without my 2 forms???

Heres' my code:

<form Method="Post" name="DisplayUserDatabase">

<%
Do While Not objDisplayRS.EOF
Response.Write "<form name=""SaveUserAccount"" method=""Post"">"
'----Retreive the information and displays it in a table
Response.Write("<TR VALIGN=""TOP"">")
Response.Write ("<TD><input type = ""text"" name = ""IDUser""
size=""3""value = """ & objDisplayRS("ID") & """>")
Response.Write(" <TD><input type=""text"" name=""NewName""
size=""20""value=""" &objDisplayRS("UserName") &""">")
Response.Write(" <TD><input type=""text"" name=""NewPswd""
size=""20""value=""" &objDisplayRS("Pswd") &""">")
Response.Write("<BR></TD>")

'Action to perform update or delete account

Response.Write(" <TD><input type=""submit""value="" Save""
onClick= ""this.form.action='
SaveUserAccount.asp?ActionToDo=UpdateAccount'; "">")
Response.Write(" <TD><input type=""submit""value="" Delete""
onClick= ""this.form.action='
SaveUserAccount.asp?ActionToDo=DeleteAccount'; "">")
Response.Write("</TR>")

Response.Write "</form>"
objDisplayRS.MoveNext
Loop

Response.Write "</TABLE>" & vbCrLf
End If

' Close DB objects and free variables
objDisplayRS.Close
Set objDisplayRS = Nothing


and in my updateUserAccount.asp, after the update call i just redirect
the user to the main form like this:

Response.Redirect "DisplayUserDatabase.asp"


Thanks Guys!
 
R

Ray at

Could you find a different way to explain your problem(s)? I don't see how
your code below relates to sessions timing out.

Ray at work
 
M

McKirahan

HolaGoogle said:
hi all,
can you please tell me what i should do to avoid session timeout when
displaying my database info in my asp form
(DisplayUserDatabase.asp)???
** actualy it does load and display the database randomly....otherwise
it's always runs into a session time out....
**Also when i save new account info (You'll notice that i've been
asked to put a save button near each record...so, it's not one global
save it's by record), i'd like to be able to save only the changed
record and nothing else. The way i do it now works, but i've to reload
to whole page and get the same timeout error!!! is there anyway to
change this??? After saving my DB info i redirect the user to the
former form (DisplayUserDatabase.asp). Maybe it's because i'm using 2
forms: one for displaying DB info(DisplayUserDatabase.asp) and another
one for saving new info(SaveUserAccount.asp)...but otherwise i don't
see how i can make this work without my 2 forms???

Heres' my code:

<form Method="Post" name="DisplayUserDatabase">

<%
Do While Not objDisplayRS.EOF
Response.Write "<form name=""SaveUserAccount"" method=""Post"">"
'----Retreive the information and displays it in a table
Response.Write("<TR VALIGN=""TOP"">")
Response.Write ("<TD><input type = ""text"" name = ""IDUser""
size=""3""value = """ & objDisplayRS("ID") & """>")
Response.Write(" <TD><input type=""text"" name=""NewName""
size=""20""value=""" &objDisplayRS("UserName") &""">")
Response.Write(" <TD><input type=""text"" name=""NewPswd""
size=""20""value=""" &objDisplayRS("Pswd") &""">")
Response.Write("<BR></TD>")

'Action to perform update or delete account

Response.Write(" <TD><input type=""submit""value="" Save""
onClick= ""this.form.action='
SaveUserAccount.asp?ActionToDo=UpdateAccount'; "">")
Response.Write(" <TD><input type=""submit""value="" Delete""
onClick= ""this.form.action='
SaveUserAccount.asp?ActionToDo=DeleteAccount'; "">")
Response.Write("</TR>")

Response.Write "</form>"
objDisplayRS.MoveNext
Loop

Response.Write "</TABLE>" & vbCrLf
End If

' Close DB objects and free variables
objDisplayRS.Close
Set objDisplayRS = Nothing


and in my updateUserAccount.asp, after the update call i just redirect
the user to the main form like this:

Response.Redirect "DisplayUserDatabase.asp"


Thanks Guys!


Sometimes processing takes more than the default 20 seconds; try :

<% Server.ScriptTimeout = 3600 %>

3600 seconds = 60 minutes
 
R

Ray at

That is insane. Would anyone really sit there waiting for an hour for a
page to finish loading? IE times out after five minutes, by default, for
one thing.

Ray at work
 
H

HolaGoogle

well it's not realy what i meant...sorry for that...just saw it...i
was trying to set my session timeout to a different time. so sorry....
So...my problem is this one: when i try to load my database, it takes
forever and sometimes just times out coz' it's too long. This happens
when i load display the database for the 1st time and all the time
after a save. I do save one record at time but always redirect the
user to the main page. That's why i'd like to be able to save the
record that has been changed and load/display changes without
reloading my whole database...
I know it's my submit button and then the response.redirect but i
don't know how to do this differently and keep my configuration as it
is....

Also, i read somewhere that acces is not designed for Internet use,
although it
can be used on the Internet via ODBC. However, it is not fast, and
its'
capacity for users is also highly limited. With a lot of records,
performance is going to be slowed.

Unfortunately i don't realy have a choice, i've to stick with it for a
while!

Any help will be realy appreciated....
 
H

HolaGoogle

I agree with you Ray...i'll never put something like that for a script
timeout! they'll kill me!!!!...is it because i,m using access with
internet or what???
 
M

McKirahan

Ray at said:
That is insane. Would anyone really sit there waiting for an hour for a
page to finish loading? IE times out after five minutes, by default, for
one thing.

Ray at work

My client must be insane then.

I use it in a database-driven, browser-based application that runs daily to
process many thousands of records.

The "page" is not for public consumption.

BTW, the application doesn't take an hour but it does take more than ten
minutes.

P.S. 3600 seconds was just an example of how to use ScriptTimeout.
 
R

Ray at

I guess it depends on the size of your recordset, the speed of your server,
and lots of other things.

But quite often, it's because of an endless loop somewhere.

Ray at work
 
H

HolaGoogle

Well...once again i do agree with you...but i did indeed checked all
those things before i post my problem....lets say even if it does not
time out then it takes realy long time to load and that, i don't realy
understand??? i realy did check everything and still don't understand
why a simple page will take all that time for simple action as
"save"...
 
M

Mark Schupp

Are you sure you don't have an infinite loop somewhere (missing rs.movenext
for instance)?
Can you show your code?
 
H

HolaGoogle

Hi Mark,
well...i did post my code. but here's it again....thansk for your help...

Heres' my code:

<form Method="Post" name="DisplayUserDatabase">

<%
Do While Not objDisplayRS.EOF
Response.Write "<form name=""SaveUserAccount"" method=""Post"">"
'----Retreive the information and displays it in a table
Response.Write("<TR VALIGN=""TOP"">")
Response.Write ("<TD><input type = ""text"" name = ""IDUser""
size=""3""value = """ & objDisplayRS("ID") & """>")
Response.Write(" <TD><input type=""text"" name=""NewName""
size=""20""value=""" &objDisplayRS("UserName") &""">")
Response.Write(" <TD><input type=""text"" name=""NewPswd""
size=""20""value=""" &objDisplayRS("Pswd") &""">")
Response.Write("<BR></TD>")

'Action to perform update or delete account

Response.Write(" <TD><input type=""submit""value="" Save""
onClick= ""this.form.action='
SaveUserAccount.asp?ActionToDo=UpdateAccount'; "">")
Response.Write(" <TD><input type=""submit""value="" Delete""
onClick= ""this.form.action='
SaveUserAccount.asp?ActionToDo=DeleteAccount'; "">")
Response.Write("</TR>")

Response.Write "</form>"
objDisplayRS.MoveNext
Loop

Response.Write "</TABLE>" & vbCrLf
End If

' Close DB objects and free variables
objDisplayRS.Close
Set objDisplayRS = Nothing
 
M

Mark Schupp

Try removing the <table> tags and just do a simple write of a single column
in the loop (followed by response.flush). If that runs quickly then
gradually build up the HTML code one step at a time to see where the delay
is.

Do While Not objDisplayRS.EOF
Response.Write objDisplayRS("ID") & "<br>" & vbCrLf
objDisplayRS.MoveNext
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top