主题:  一个关于定时显示的疑问。

萧秋枫

职务:普通成员
等级:1
金币:0.0
发贴:5
注册:2002/10/23 21:27:58
#12003/6/9 16:20:34
<% if tjhy.Fields.Item("ondate").value<=nowtime.Fields.Item("nt2").value then%>
<%=(tjhy.Fields.Item("tj").value)%>

帮我看一下这两段那里错了。
nowtime.Fields.Item("nt2").value是我的网页每次刷新access数据库相应更新的当前时间,用来跟tjhy.Fields.Item("ondate").value做对比,当ondate <= nt2时,就显示这个<%=(tjhy.Fields.Item("tj").value)%>


但是不行,为什么啊。。。 :confused: :confused:

大侠们救我~~~~我是刚入门。。。

编辑历史:[这消息被allinhands编辑过(编辑时间2003-06-09 16:28:47)]


萧秋枫

职务:普通成员
等级:1
金币:0.0
发贴:5
注册:2002/10/23 21:27:58
#22003/6/9 16:22:29
<% if tjhy.Fields.Item("ondate").value<=nowtime.Fields.Item("nt2").value then%>
<%=(tjhy.Fields.Item("tj").value)%>



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
注册:2004/1/14 19:14:47
#32003/6/9 16:30:14
什么样的错误提示?



萧秋枫

职务:普通成员
等级:1
金币:0.0
发贴:5
注册:2002/10/23 21:27:58
#42003/6/9 16:39:54
没昏误提示,就是不能对比,所以我自己也不知道错在那里。

源文件在这里,关键我觉得就是121、122这两行。
hailongit.www1.cn4e.com/aaa.exe



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
注册:2004/1/14 19:14:47
#52003/6/9 17:26:31
我没有时间仔细看你的程序,我也不知道你的数据库程序到底怎么设计的.

不过我把<=改成>后就可以显示内容,那么可能就是你的条件没有满足,或者在这方面你有什么考虑欠缺的地方.



萧秋枫

职务:普通成员
等级:1
金币:0.0
发贴:5
注册:2002/10/23 21:27:58
#62003/6/9 17:32:01
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<%
Dim tjhy
Dim tjhy_numRows

Set tjhy = Server.CreateObject("ADODB.Recordset")
tjhy.ActiveConnection = MM_z921_STRING
tjhy.Source = "SELECT * FROM tj_sy ORDER BY id DESC"
tjhy.CursorType = 0
tjhy.CursorLocation = 2
tjhy.LockType = 1
tjhy.Open()

tjhy_numRows = 0
%>
<%

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_z921_STRING
Command1.CommandText = "UPDATE connt SET connt = connt + 1 WHERE connt "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

%>
<%
Dim nowtime
Dim nowtime_numRows

Set nowtime = Server.CreateObject("ADODB.Recordset")
nowtime.ActiveConnection = MM_z921_STRING
nowtime.Source = "SELECT * FROM Nowtime ORDER BY id DESC"
nowtime.CursorType = 0
nowtime.CursorLocation = 2
nowtime.LockType = 1
nowtime.Open()

nowtime_numRows = 0
%>
<%

set Command2 = Server.CreateObject("ADODB.Command")
Command2.ActiveConnection = MM_z921_STRING
Command2.CommandText = "INSERT INTO Nowtime (nt1) valueS (1) "
Command2.CommandType = 1
Command2.CommandTimeout = 0
Command2.Prepared = true
Command2.Execute()

%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
tjhy_numRows = tjhy_numRows + Repeat1__numRows
%>

Welcome to <A HREF="http://www.chinatips.com" TARGET=_blank>www.chinatips.com
















<%
While ((Repeat1__numRows <> 0) AND (NOT tjhy.EOF))
%>








<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
tjhy.MoveNext()
Wend
%>
时间
上盤
讓球
下盤
class=unnamed1>推荐
输赢
<%=(tjhy.Fields.Item("ondate").value)%>
<%=(tjhy.Fields.Item("sp").value)%>
<%=(tjhy.Fields.Item("yq").value)%>
<%=(tjhy.Fields.Item("xp").value)%>

border=0 align="center"
cellPadding=0 cellSpacing=0 class="force">


















<% if tjhy.Fields.Item("ondate").value<=nowtime.Fields.Item("nt2").value then%>

<%else%>

<%end if%>















<%=(tjhy.Fields.Item("tj").value)%>
 

">


<%
tjhy.Close()
Set tjhy = Nothing
%>
<%
nowtime.Close()
Set nowtime = Nothing
%>



萧秋枫

职务:普通成员
等级:1
金币:0.0
发贴:5
注册:2002/10/23 21:27:58
#72003/6/9 17:32:27
能帮我看一下那儿有问题吗?



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
注册:2004/1/14 19:14:47
#82003/6/9 19:43:28
我说了,我不知道那个比赛的逻辑关系,所以我不知道该怎么判断.