计数器统计问题,菜鸟问题

xzjxu 2005-11-02 05:43:24
asp代码如下,请看一下注释掉的那一部分有什么错误吗?为什么days1表总是坏掉???

<%
mypath="http://cx.100asp.com/count/"
id=Request.QueryString("id")
if trim(id)<>EMPTY then
set conn=server.createobject("adodb.connection")
'conn.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " &
Server.MapPath("count.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" &
Server.MapPath("count.mdb")
set rs=server.createobject("adodb.recordset")

Application.Lock '将对象锁定
SQLcmd = "select * from count where id='" & trim(id) & "'"
set rs=conn.Execute(SQLcmd)

if not rs.EOF then
dir=trim(rs("dir"))
k=rs("len")
count=rs("count")
a=session("a")
if ucase(typename(a))="EMPTY" then
redim a(0)
a(0)=id
session("a")=a
count=count+1
SQLcmd1 = "update count set count=" & cstr(count) & " where id='" &
trim(id) & "'"
conn.Execute SQLcmd1
SQLcmd1="insert into times(id,[time]) values('" & id & "','" & now & "')"
conn.Execute SQLcmd1
' tim=now
' SQLcmd = "select * from days1 where id='" & trim(id) & "' and hourS='" &
cstr(hour(tim)) & "'"
' set rs=conn.Execute(SQLcmd)
' if not rs.EOF then
' count=rs("count")
' count=count+1
' SQLcmd1 = "update days1 set count='" & cstr(count) & "' where id='" &
trim(id) & "' and hours='" & cstr(hour(tim)) & "'"
' conn.Execute SQLcmd1
' else
' SQLcmd1="insert into days1(id,hours,count) values('" & id & "','" &
cstr(hour(tim)) & "','1')"
' conn.Execute SQLcmd1
' end if
else
for i=0 to ubound(a)
if ucase(trim(id))=ucase(trim(a(i))) then exit for
next
if i>ubound(a) then
redim preserve a(ubound(a)+1)
a(ubound(a))=id
session("a")=a
count=count+1
SQLcmd1 = "update count set count=" & cstr(count) & " where id='" &
trim(id) & "'"
conn.Execute SQLcmd1
SQLcmd1="insert into times(id,[time]) values('" & id & "','" & now &
"')"
conn.Execute SQLcmd1
' tim=now
' SQLcmd = "select * from days1 where id='" & trim(id) & "' and hours='"
& cstr(hour(tim)) & "'"
' set rs=conn.Execute(SQLcmd)
' if not rs.EOF then
' count=rs("count")
' count=count+1
' SQLcmd1 = "update days1 set count='" & cstr(count) & "' where id='" &
trim(id) & "' and hours='" & cstr(hour(tim)) & "'"
' conn.Execute SQLcmd1
' else
' SQLcmd1="insert into days1(id,hours,count) values('" & id & "','" &
cstr(hour(tim)) & "','1')"
' conn.Execute SQLcmd1
' end if
end if
end if
conn.close
x = right(string(k,"0") & CStr(count),k)
%>
document.write("<% For i = 1 To Len(x)%><img border='0'
src='<%=mypath%><%=dir%>/<%=mid(x,i,1)%>.bmp'><%Next%>")
<% end if
Application.UnLock '将对象解除锁定
end if
%>

...全文
176 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
shaka282216034 2005-11-03
  • 打赏
  • 举报
回复
ASP代码阿?
看的头疼
建议转向ASP.NET
guanshenglang 2005-11-03
  • 打赏
  • 举报
回复
asp 的呀!建议到asp栏目提问

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧