尝试读取数据库时的会话超时 [英] Session Timeout when trying to read database

查看:69
本文介绍了尝试读取数据库时的会话超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

你可以告诉我我应该做些什么来避免会话超时

以我的asp形式显示我的数据库信息

(DisplayUserDatabase.asp)???

**实际上它会随机加载并显示数据库....否则

它总是遇到一个会话超时....

**此外,当我保存新的帐户信息时(你会注意到我已经

要求放一个保存按钮靠近每条记录...所以,它不是一个全球的

保存它的记录),我希望能够只保存更改的

记录,没有别的。我这样做的方式现在有效,但我必须重新加载

到整个页面并获得相同的超时错误!无论如何要

改变这个???保存我的数据库信息后,我将用户重定向到

前表格(DisplayUserDatabase.asp)。也许是因为我使用的是2

表格:一个用于显示数据库信息(DisplayUserDatabase.asp),另一个用于保存新信息的另一个用于
的表格(SaveUserAccount。 asp)...但是除此之外我不会b / b看看如何在没有我的2个表格的情况下完成这项工作???


继承人''我的代码:


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


<%

Do While Not objDisplayRS.EOF

Response.Write" < form name ="" SaveUserAccount"" method ="" Post"">"

''----检索信息并将其显示在表格中

Response.Write(" ;< TR VALIGN ="" TOP"">")

Response.Write("< TD>< input type ="" text"""名称= QUOT;" ID用户所""

大小= QUOT;" 3英寸;"值= QUOT;""&安培; objDisplayRS(QUOT; ID")&安培;"" ;">")

Response.Write("<< TD>< input type ="" text"" name ="" NewName"" <登记/>
大小= QUOT;" 20""值= QUOT;""&安培; objDisplayRS(QUOT;用户名")&安培;""">")

Response.Write("< TD>< input type ="" text"" name ="" NewPswd""

size =" " 20" value ="""& objDisplayRS(" Pswd")&""">")

Response.Write("< BR>< / TD>")

''执行更新或删除帐户的操作


Response.Write(" < TD>< input type ="" submit"" value =""保存"

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

循环

Response.Write"< / TABLE>" &安培; vbCrLf

结束如果


''关闭DB对象和自由变量

objDisplayRS.Close

设置objDisplayRS = Nothing

,在我的updateUserAccount.asp中,在更新调用之后我只需将用户重定向

这样的主窗体:


Response.Redirect" DisplayUserDatabase.asp"

谢谢大家!

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!

推荐答案

你能找到一个解释你的问题的不同方式?我不知道下面你的代码与会话超时有什么关系。


Ray在工作中


HolaGoogle <豪***** @ yahoo.com>在留言中写道

news:cd ************************** @ posting.google.c om ...
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

"HolaGoogle" <ho*****@yahoo.com> wrote in message
news:cd**************************@posting.google.c om...
大家好,
你可以告诉我当我用我的asp格式显示我的数据库信息时我应该做些什么来避免会话超时
(DisplayUserDatabase.asp) ???
**实际上它会随机加载并显示数据库....否则
它总会遇到会话超时....
**当我保存了新的帐户信息(你会注意到我已被要求在每条记录附近放一个保存按钮......所以,它不是一个全球性的
保存它''记录),我希望能够只保存更改的
记录,而不是其他任何内容。我现在这样做的方式有效,但我必须重新加载到整个页面并获得相同的超时错误!无论如何要改变这个???保存我的数据库信息后,我将用户重定向到
前一个表单(DisplayUserDatabase.asp)。也许这是因为我使用2
形式:一个用于显示数据库信息(DisplayUserDatabase.asp),另一个用于保存新信息(SaveUserAccount.asp)...但是否则我不知道如何在没有我的2个表格的情况下完成这项工作???

Heres''我的代码:

< form Method =" ;邮政" name =" DisplayUserDatabase">

<%
Do While Not objDisplayRS.EOF
Response.Write"< form name ="" SaveUserAccount"" ; method ="" Post"">"
''----检索信息并将其显示在表格中
Response.Write("< TR VALIGN =" " TOP"">")
回复于("< TD><输入类型= QUOT;"文本""名称= QUOT;" ID用户所"" <无线电通信/> size ="" 3"" value ="""& objDisplayRS(" ID")&""">")
Response.Write( "< TD>< input type ="" text"" name ="" NewName""
size ="" 20"" value =""" ;&安培; objDisplayRS(QUOT;用户名")&安培;""">")
回复于("< TD><输入类型= QUOT;"文本""名称= QUOT;" NewPswd""
大小= QUOT;" 20""值= QUOT;""&安培; objDisplayRS(QUOT; PSWD")&安培;"""> ;")
Response.Write("< BR> < / TD>")

''执行更新或删除帐户的行动

Response.Write(" < TD>< input type ="" submit"" value =""保存"
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
循环

Response.Write" < /表>" &安培; vbCrLf
结束如果

''关闭DB对象和自由变量
objDisplayRS.Close
设置objDisplayRS = Nothing

和我的updateUserAccount .asp,在更新调用后我只是将用户重定向到主窗体,如下所示:

Response.Redirect" DisplayUserDatabase.asp"

谢谢你们!
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!



" HolaGoogle" <豪***** @ yahoo.com>在留言中写道

news:cd ************************** @ posting.google.c om ...
"HolaGoogle" <ho*****@yahoo.com> wrote in message
news:cd**************************@posting.google.c om...
大家好,
你可以告诉我当我用我的asp格式显示我的数据库信息时我应该做些什么来避免会话超时
(DisplayUserDatabase.asp) ???
**实际上它会随机加载并显示数据库....否则
它总会遇到会话超时....
**当我保存了新的帐户信息(你会注意到我已被要求在每条记录附近放一个保存按钮......所以,它不是一个全球性的
保存它''记录),我希望能够只保存更改的
记录,而不是其他任何内容。我现在这样做的方式有效,但我必须重新加载到整个页面并获得相同的超时错误!无论如何要改变这个???保存我的数据库信息后,我将用户重定向到
前一个表单(DisplayUserDatabase.asp)。也许这是因为我使用2
形式:一个用于显示数据库信息(DisplayUserDatabase.asp),另一个用于保存新信息(SaveUserAccount.asp)...但是否则我不知道如何在没有我的2个表格的情况下完成这项工作???

Heres''我的代码:

< form Method =" ;邮政" name =" DisplayUserDatabase">

<%
Do While Not objDisplayRS.EOF
Response.Write"< form name ="" SaveUserAccount"" ; method ="" Post"">"
''----检索信息并将其显示在表格中
Response.Write("< TR VALIGN =" " TOP"">")
回复于("< TD><输入类型= QUOT;"文本""名称= QUOT;" ID用户所"" <无线电通信/>尺寸= QUOT;" 3英寸;"值= QUOT;""&安培; objDisplayRS(QUOT; ID")&安培;""">")
回复于( "< TD><输入类型= QUOT;"文本""名称= QUOT;"新名称""
大小= QUOT;" 20""值= QUOT;"" ;&安培; objDisplayRS(QUOT;用户名")&安培;""">")
回复于("< TD><输入类型= QUOT;"文本""名称= QUOT;" NewPswd""
大小= QUOT;" 20""值= QUOT;""&安培; objDisplayRS(QUOT; PSWD")&安培;"""> ;")
Response.Write("< BR> < / TD>")

''执行更新或删除帐户的行动

Response.Write(" < TD>< input type ="" submit"" value =""保存"
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
循环

Response.Write" < /表>" &安培; vbCrLf
结束如果

''关闭DB对象和自由变量
objDisplayRS.Close
设置objDisplayRS = Nothing

和我的updateUserAccount .asp,在更新调用后我只是将用户重定向到主窗体,如下所示:

Response.Redirect" DisplayUserDatabase.asp"

谢谢你们!
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!



有时处理时间超过默认的20秒;尝试:


<%Server.ScriptTimeout = 3600%>


3600秒= 60分钟


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

<% Server.ScriptTimeout = 3600 %>

3600 seconds = 60 minutes


那是疯了。有人真的会坐在那里等待一个小时的

页面来完成加载吗? IE在五分钟后超时,默认情况下为

一件事。


雷在工作


" ; McKirahan" <氖** @ McKirahan.com>在消息中写道

news:VEdhb.527794
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

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:VEdhb.527794


这篇关于尝试读取数据库时的会话超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆