计数器统计问题,菜鸟问题
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
%>
<%
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
%>
...全文
相关推荐
LTEKPI指标详解菜鸟零基础提升篇.pdf
九、用到的计数器说明用到的计数器说明是进行计算该指标时所用到的计数器以及相关的说明。十、备注备注是其他字段所没有解释到的,需要注意的地方。
ASP.NET菜鸟之路之Application小例子
"ASP.NET菜鸟之路之Application小例子"在ASP.NET开发中,Application对象是一个非常重要的组件,尤其对于处理全局性、多用户共享的数据时。本文档主要通过一个简单的示例
LTE-KPI指标详解菜鸟零基础提升篇.doc编程资料
"LTE-KPI指标详解菜鸟零基础提升篇"在LTE(Long-Term Evolution)网络中,Key Performance Indicators(KPIs)是评估网络性能的关键参数。这篇文
LabVIEW数据采集DAQ实例源代码,菜鸟飞跃的台阶!
通过逐步分析和运行这些源代码,你可以深入理解DAQ的原理和LabVIEW编程技术,从而从菜鸟变为精通数据采集的专家。
c++经典小程序 给菜鸟的!!1
**统计字符串中的单词和字母** 在这个小程序中,我们看到一个简单的C++程序,用于计算用户输入的字符串中包含的单词数量和字母总数。


