Hallo,
hab ein ASP Chat mit reingenommen, nun bekomme ich als die Fehlermeldung
"Script Timeout".
kann ich im folgendem Code das Timeout irgendwo beeinflussen bzw. ver�ndern?
Ich hab mich total verwurschtelt...
<!-- #INCLUDE FILE="adovbs.inc" -->
<%
'page will show, when is all loaded
Response.Buffer = True
'page can't be refreshed
Response.Expires = -1000
'name of chat database
Const ChatMDB = "E:\dbroot\chat.mdb" 'relative path to database
Const Records = 20 'how many records will be shown at one page
Const TimeOut = 10 'inactivity timeout in minutes
Const SiteTitle = "ASP CHAT created by DETONATOR-TREIBER.COM
[EMAIL PROTECTED] "
Function Connect (Path2DB)
Set DB = Server.CreateObject("ADODB.Connection")
DB.Mode = adModeReadWrite 'Since we will be adding entries.
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
Server.MapPath(Path2DB))
Set Connect = DB
End Function
Function Session_TimeOut ()
on error resume next
db=Connect (ChatMDB)
Set rst = Server.CreateObject ("ADODB.Recordset")
rst.Open "Select * FROM USERS", DB, adOpenStatic, adLockPessimistic
do until rst.eof
tmpTim=rst("LAST")
tmpH=Hour(tmpTim)
tmpM=Minute(tmpTim)
tmpM=clng(tmpM)+TimeOut
if clng(tmpM) >59 then
tmpH=clng(tmpH)+1
tmpM=clng(tmpM)-60
if clng(tmpH)>23 then
tmpH=clng(tmpH)-23
end if
end if
if not clng(hour(Time))=clng(tmpH) and not clng(hour(Time))+1=clng(tmpH)
then
DeleteUserTemp rst("ROOM"), rst("NICK")
rst.delete
rst.Update
else
if clng(tmpH)=clng(hour(time)) and clng(tmpM) < clng(Minute(Time)) then
DeleteUserTemp rst("ROOM"), rst("NICK")
rst.delete
rst.Update
end if
if clng(tmpH)=clng(hour(time))+1 and clng(tmpM) > clng(Minute(Time))
then
DeleteUserTemp rst("ROOM"), rst("NICK")
rst.delete
rst.Update
end if
end if
rst.MoveNext
loop
'this is for slow down / prevent errors with more than once accessing some
data
tmr=Timer
do until tmr+0.1<Timer
loop
End Function
Function DeleteUserTemp(Room, User)
on error resume next
'remove all messages sent privatly to this user
if not user="" then
db=Connect (ChatMDB)
Set rst2 = Server.CreateObject ("ADODB.Recordset")
rst2.Open "Select * FROM MESSAGES WHERE OPTIONS = '" & user & "'", DB,
adOpenStatic, adLockPessimistic
do until rst2.EOF
rst2.Delete
rst2.Update
rst2.Movenext
loop
end if
'add logout message
Set rst2 = Server.CreateObject ("ADODB.Recordset")
rst2.Open "Select * FROM MESSAGES", DB, adOpenStatic, adLockPessimistic
rst2.addnew
rst2("FROM")=user
rst2("TIME")=Time
rst2("MSG_TYPE")=1
rst2("OPTIONS")="&TO_ALL"
rst2("ROOM_ID")=clng(ROOM)
rst2("MSG")="...:: " & server.HTMLencode(user) & " has been disconnected
(session timeout expired) ::..."
rst2.update
'increase number of messages to view
Set rst2 = Server.CreateObject ("ADODB.Recordset")
rst2.Open "Select * FROM USERS WHERE (ROOM = " & clng(ROOM) & ") AND
(MESSAGES < " & clng(Records) & ")" , DB, adOpenStatic, adLockPessimistic
do until rst2.eof
rst2("MESSAGES")=clng(rst2("MESSAGES"))+1
rst2.update
rst2.movenext
loop
'delete record which is above
set rst2 = Server.CreateObject ("ADODB.Recordset")
rst2.Open "Select * FROM MESSAGES WHERE (ROOM_ID = " & clng(ROOM) & ") AND
(OPTIONS = '&TO_ALL') ORDER BY ID ASC", DB, adOpenStatic, adLockPessimistic
do until rst2.eof
if rst2.RecordCount>Records then
rst2.delete
rst2.update
exit do
end if
rst2.movenext
loop
End Function
%>
Gruss Kai
| Oft Gefragtes: http://www.aspgerman.com/aspgerman/faq/
| [aspdebeginners] als [email protected] subscribed
| http://www.aspgerman.com/archiv/aspdebeginners/ = Listenarchiv
| Sie knnen sich unter folgender URL an- und abmelden:
| http://www.aspgerman.com/aspgerman/listen/anmelden/aspdebeginners.asp