日期:2014-05-17  浏览次数:20862 次

晕啊!!!!!!!关于记录在线用户在线时间的问题?
为了计算登录用户在线时间,在conn.asp页内加入了一个隐藏帧,代码如下:
<iframe   name= "Detail "   id= "Detail "   frameborder= "0 "   hspace= "0 "   vspace= "0 "   src= "refresh.asp "   style= "display:none "> </iframe>

refresh.asp页的功能是定时刷新数据库内在线用户的相关登录信息;页面代码如下:
<META   http-equiv=refresh   content=300>
<META   http-equiv=Pragma   content=no-cache>
<META   http-equiv=Content-Type   content= "text/html;   charset=utf-8 ">
<%
dim   connstr,systemtime,strnum,str
dim   db
db= "database/database.mdb "             '数据库文件的位置
if   session( "username ") <> " "   then

systemtime=formatdatetime(time,3)
systemtime=left(systemtime,8)
str=split(systemtime, ": ")
strnum=str(0)&str(1)&str(2)

if   session( "starttimes ") <> " "   then
    if     datedIff( "n ",session( "starttimes "),Now())> 1   then

On   Error   Resume   Next
Set   conn   =   Server.CreateObject( "ADODB.Connection ")
connstr= "Provider=Microsoft.Jet.OLEDB.4.0;Data   Source= "   &   Server.MapPath(db)
conn.Open   connstr

if   (strnum> 120000   and   strnum <125959)   or   (strnum> 10000   and   strnum <20000)   then

      conn.execute( "update   FP_User   set   mlogouttime= ' "&now()& " ',   mtotaltime=mtotaltime   +   "&datedIff( "n ",session( "starttimes "),Now())& "   where   username= ' "&session( "username ")& " ' ")

else  
if   strnum> 50000   and   strnum <70000   then

conn.execute( "update   FP_User   set   alogouttime= ' "&now()& " ',atotaltime=atotaltime   +   "&datedIff( "n ",session( "starttimes "),Now())& "   where   username= ' "&session( "username ")& " ' ")
end   if

end   if
     
      session( "starttimes ")=Now()
    end   if
  else
  session( "starttimes ")=Now()
  end   if
end   if


%>

说明:

session( "starttimes "):记录用户登录时间;
strnum:用户登录时间(该变量格式化为符串),由此变量做条件分时间段更新用户相关信息。


我就觉得郁闷,在我的本机上可以定时更新数据库;但一上传到服务器后;就不能更新,大家帮忙看看,谢谢了!

在线等。。。


------解决方案--------------------
不能更新的表现是什么?
------解决方案--------------------
你的代码未必有问题 可能是服务器的配置的问题啊

也许是ntfs的格式的原因啊

需要配置权限或者其他的什么原因的


------解决方案--------------------
同样问题
等答案
------解决方案--------------------
NTFS分区的话要给予everyone的权限,
具体权限在目录属性-安全里设置
------解决方案--------------------
这咋跟我写的差不多呀

长的这么像

http://www.yongfa365.com/blog/item/9ed0df87b435e489.htm