老大们帮我看这段代码!

qwertyasd 2003-07-10 06:47:07
<%
nowtime=now()
shijian=cstr(year(nowtime))+right("0"+cstr(month(nowtime)),2)+right("0"+cstr(day(nowtime)),2)+right("0"+cstr(hour(nowtime)),2)+right("0"+cstr(minute(nowtime)),2)
strSQL ="SELECT * FROM calendar where (userid="&session("Uid")&" and state=false and remindtime<'"&shijian&"') ORDER BY id DESC"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSQL,Conn,1,1
if not rs.eof then
do while not (rs.eof or rs.bof)
%>
<script LANGUAGE="JavaScript">
<!--
OpenWindows1('checkcalendar.asp?id='+<%=rs("id")%>,'width=500','height=300') //这条语句怎么循环起来没完呀?可是calendar表只有3条记录呀!
//-->
</script>
<%rs.movenext
loop
else%>

<body bgColor=#276db2 leftMargin=0 topMargin=0 marginheight="0"
marginwidth="0">
<%
end if
...全文
81 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
anonyman 2003-07-11
  • 打赏
  • 举报
回复
另外把该部分代码拿出来另外新建一个文件调试
anonyman 2003-07-11
  • 打赏
  • 举报
回复
while not rs.eof
response.write rs(1)
rs.movenext
wend
qwertyasd 2003-07-11
  • 打赏
  • 举报
回复
: anonyman(anonyman)
你用的方法早试过了!
anonyman 2003-07-11
  • 打赏
  • 举报
回复
不应该只是去问,而是应该知道怎么去分析问题,一个很有经验的程序员,很大程度上是他的调试经验够
anonyman 2003-07-11
  • 打赏
  • 举报
回复
你将这段代码换其它的试试:
script LANGUAGE="JavaScript">
<!--
OpenWindows1('checkcalendar.asp?id='+<%=rs("id")%>,'width=500','height=300') //这条语句怎么循环起来没完呀?可是calendar表只有3条记录呀!
//-->
</script>
eg:
do while not (rs.eof or rs.bof)
response.write rs(1)
rs.movenext
loop
zykj_2000 2003-07-11
  • 打赏
  • 举报
回复
应该没有错啊
qwertyasd 2003-07-11
  • 打赏
  • 举报
回复
老大们,帮忙!
anonyman 2003-07-11
  • 打赏
  • 举报
回复
在这就有点区别了,记录集的光标位置
julyclyde 2003-07-11
  • 打赏
  • 举报
回复
条件在前的DO.LOOP和while。WEND一样

微软社区之星(Feb,2003)
我的文章http://www.csdn.net/develop/MY_article.asp?author=julyclyde
qwertyasd 2003-07-11
  • 打赏
  • 举报
回复
用wend解决了,但是wend和 loop在用法上有和区别?
qwertyasd 2003-07-10
  • 打赏
  • 举报
回复
这个我是知道的原来我用delphi,access,sql server都用过,但现在就是这几条出错!
BrightEye 2003-07-10
  • 打赏
  • 举报
回复
查询语句有问题.SQL跟ACCESS有细微的差别.注意数据类型的匹配.
qwertyasd 2003-07-10
  • 打赏
  • 举报
回复
do while not (rs.eof)//这样也不行,试过了,而且我把记录都删了也不行!
郁闷!
BrightEye 2003-07-10
  • 打赏
  • 举报
回复
do while not (rs.eof or rs.bof)
%>
<script LANGUAGE="JavaScript">
<!--
OpenWindows1('checkcalendar.asp?id='+<%=rs("id")%>,'width=500','height=300') //这条语句怎么循环起来没完呀?可是calendar表只有3条记录呀!
//-->
</script>
<%rs.movenext
loop
===========================>
do while not (rs.eof)
%>
<script LANGUAGE="JavaScript">
<!--
OpenWindows1('checkcalendar.asp?id='+<%=rs("id")%>,'width=500','height=300') //这条语句怎么循环起来没完呀?可是calendar表只有3条记录呀!
//-->
</script>
<%rs.movenext
loop
qwertyasd 2003-07-10
  • 打赏
  • 举报
回复
原来是access的没问题,我改成sql server的就出问题了!~

data.asp的代码
——————————————————
<%
dim conn
dim connstr
on error resume next
connstr="driver={SQL Server};server=wjh;uid=sa;pwd=;database=wyoa"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>


qjrein 2003-07-10
  • 打赏
  • 举报
回复
这好像是金领的代码,你修复一下浏览器,有可能是浏览器对javascript支持不好
杨小杨 2003-07-10
  • 打赏
  • 举报
回复
我也用的这个!没有出现你那样的问题!
杨小杨 2003-07-10
  • 打赏
  • 举报
回复
代码本身没有错的!

这是一个OA的源代码中的一段吧!
anonyman 2003-07-10
  • 打赏
  • 举报
回复
do while not rs.eof

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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