找回密码
 注册
【阿里云】2核2G云服务器新老同享 99元/年,续费同价,云服务器3年机/5年机限时抢购,低至 2.5折华为云精选云产品特惠糖果主机Jtti,新加坡服务器,美国服务器,香港服务器,海外云服务器
查看: 568|回复: 1

会ASP代码的看看哪里错了

[复制链接]
发表于 2008 年 10 月 6 日 14:31:31 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
如何修改错误

错误类型:
Microsoft JET Database Engine (0x80040E07)
日期的语法错误 在查询表达式 'NowTime<#2008-10-6 下午 02:06:00#' 中。
/jk/inc/CountOnline.asp, 第 16 行



下面是inc/CountOnline.asp这个文件内容
<!--#include file="getIP.asp"-->
<%
'==============================================================================================
   '函数名:站点在线用户及流量统计
   '函数返回值:void
   '参数:
   'Author:marquee 2005-6-21
'==============================================================================================
IF lc_CountOnline = True Then
        Call CountOnline()
End IF       
Function CountOnline()
        Dim passTime,currentTime
        currentTime = CDate(YEAR(DATE)&"-"&MONTH(DATE)&"-"&DAY(DATE)&" "&HOUR(TIME)&":"&MINUTE(TIME)&":"&SECOND(TIME))
        passTime = CDate(currentTime - lc_Interval)
        conn.execute("delete * from lc_Online where NowTime<#"&passTime&"#")
        Set oRs = Server.CreateObject("Adodb.Recordset")
        oRs.open "select * from lc_Online where UserIP='"&getIP()&"'",conn,1,3
        IF oRs.eof then
                oRs.addnew
                oRs("userIP") = getIP()
                IF Request.Cookies(lc_CookieName)("MemberID")<>"" Then
                        oRs("MemberName") = Request.Cookies(lc_CookieName)("MemberID")
                        oRs("UserType") = Request.Cookies(lc_CookieName)("MemberType")
                Else
                        oRs("MemberName") = "游客"
                        oRs("UserType") = "游客"
                End IF
                oRs("ComeTime") = now()
                oRs("NowTime") = now()
                IF Cstr(Request.ServerVariables("Query_String"))<>"" Then
                        oRs("CurrentArea") = Request.ServerVariables("URL") & "?" & Request.ServerVariables("Query_String")
                Else
                        oRs("CurrentArea") = Request.ServerVariables("URL")
                End IF
                set tmpCount = conn.execute("select count(ID) from lc_Online")
                Set scRs = Server.CreateObject("Adodb.Recordset")
                scRs.open "select * from lc_SiteCount",conn,1,3
                scRs("AccessSum") = scRs("AccessSum") + 1
                scRs("NowOnline") = tmpCount(0)
                IF scRs("MaxOnlineCount") < tmpCount(0) Then
                        scRs("MaxOnlineCount") = tmpCount(0)
                        scRs("MaxOnlineTime") = now()
                End IF
                IF scRs("CountDate") = date() Then
                  scRs("TodayAccessCount") = scRs("TodayAccessCount") + 1
                Else
                  scRs("TodayAccessCount") = 0
                  scRs("CountDate") = date()
                End IF
                scRs.update
                scRs.close
                set scRs = nothing
                set tmpCount = nothing
        Else
                set tmpCount = conn.execute("select count(ID) from lc_Online")
                conn.execute("update lc_SiteCount set viewSum=viewSum+1,NowOnline="&tmpCount(0))
                oRs("NowTime") = now()
                IF Request.Cookies(lc_CookieName)("MemberID")<>"" Then
                        oRs("MemberName") = Request.Cookies(lc_CookieName)("MemberID")
                        oRs("UserType") = Request.Cookies(lc_CookieName)("MemberType")
                Else
                        oRs("MemberName") = "游客"
                        oRs("UserType") = "游客"
                End IF
                IF Cstr(Request.ServerVariables("Query_String"))<>"" Then
                        oRs("CurrentArea") = Request.ServerVariables("URL") & "?" & Request.ServerVariables("Query_String")
                Else
                        oRs("CurrentArea") = Request.ServerVariables("URL")
                End IF
        End IF
        oRs.update
        oRs.close
        set oRs = Nothing
End Function



'==============================================================================================
   '函数名:在线用户显示
   '函数返回值:void
   '参数:
   'Author:marquee 2005-6-21
'==============================================================================================
Function DisplayOnline(colNum,displayNum,displayPage,showTopPage,showBottomPage)
        Dim displayContent
          Set rs = Server.createObject("Adodb.Recordset")
        Sql = "select * from lc_Online"
        rs.open sql,conn,1,1
        rs.pagesize=displayNum
        countPage=rs.PageCount
          PerPageSize=rs.pagesize
          IF displayPage<=0 Then
            displayPage=0
            movepage=0
          End IF
          movepage=CInt(displayPage)*PerPageSize

          IF Cint(displayPage)>=countPage Then
            displayPage=countPage-1
            movepage=displayPage*perpagesize
          End IF

          IF showTopPage=1 Then                              '首页
            movepage=0
          End IF

          IF showBottomPage=1 Then     '末页
             movepage=(rs.pagecount-1)*PerPageSize  
              displayPage=countPage-1                                 
        End IF

           i=0
          rs.move movepage
        displayContent = displayContent & "<table width=""100%""  border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbCrlf

        do while not rs.eof and i<displayNum/colNum
        displayContent = displayContent & "<tr>" & vbCrlf
        for k=1 to colNum
                IF Not rs.eof Then
                        displayContent = displayContent & "<td align=""center""><img src=""images/dot6.gif""><span title=""" &rs("MemberName")& "<br>访问IP:"&rs("userIP")&"<br>访问时间:" &rs("comeTime")& "<br>当前位置:" &rs("currentArea")& """ style=""cursor:hand"" onMouseOver=""this.className='redText';"" onMouseOut=""this.className='blackText';"">"&rs("MemberName")&"</span></td>" & vbCrlf
                        rs.movenext
                Else
                        displayContent = displayContent & "<td align=""center"">&nbsp; ; ; ;</td>" & vbCrlf
                End IF
        next
        displayContent = displayContent & "</tr>" & vbCrlf
        loop
        displayContent = displayContent & "</table>" & vbCrlf

        displayContent = displayContent & "<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbCrlf
        displayContent = displayContent & "<tr><td colspan=""6"" height=""20""></td></tr>" & vbCrlf
           displayContent = displayContent & "<tr>" & vbCrlf
           displayContent = displayContent & "<td align=""center"">&nbsp; ; ; ;</td>" & vbCrlf
           displayContent = displayContent & "<td width=""10%"" align=""center"">[<a href=""" & listLinkPath & "?topPage=1"">首页</a>]</td>" & vbCrlf
           displayContent = displayContent & "<td width=""11%"" align=""center"">[<a href=""" & listLinkPath & "?page=" & CInt(displayPage)-1 & """>上一页</a>]</td>" & vbCrlf
           displayContent = displayContent & "<td width=""11%"" align=""center"">[<a href=""" & listLinkPath & "?page=" & CInt(displayPage+1) & """>下一页</a>]</td>" & vbCrlf
           displayContent = displayContent & "<td width=""10%"" align=""center"">[<a href=""" & listLinkPath & "?bottomPage=1"">末页</a>]</td>" & vbCrlf

           displayContent = displayContent & "<td width=""10%""><select name=""select"" onChange=""window.location.href='" &listLinkPath& "?page='+options[selectedIndex].value"">" & vbCrlf
   
           for k = 0 to countPage-1
            IF (displayPage+1) = (k+1) Then
                    displayContent = displayContent & "<option value=""" &k& """ selected>" &k+1& "</option>" & vbCrlf
            Else
                displayContent = displayContent & "<option value=""" &k& """>" &k+1& "</option>" & vbCrlf
            End IF
           next
           displayContent = displayContent & "</select></td>" & vbCrlf
   
           displayContent = displayContent & "<td width=""25%"" align=""center"">当前页/总页数:&nbsp; ; ; ;<span class=""redText"">" & (displayPage+1) & "/" & Cint(countPage) & "</span></td>" & vbCrlf
          displayContent = displayContent & "<td align=""center"">&nbsp; ; ; ;</td>" & vbCrlf
           displayContent = displayContent & "</tr>" & vbCrlf
           displayContent = displayContent & "</table>" & vbCrlf
        DisplayOnline = displayContent
End Function
%>

[ 本帖最后由 aylhl 于 2008-10-6 14:32 编辑 ]
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
 楼主| 发表于 2008 年 10 月 6 日 14:49:38 | 显示全部楼层
【腾讯云】2核2G云服务器新老同享 99元/年,续费同价
懂的人没在吗
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|金光论坛

GMT+8, 2024 年 9 月 20 日 19:52 , Processed in 0.113870 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表