“预期陈述”在 If then 语句中
我有一个经典的 asp 应用程序,如果用户选择将此报告导出到 Excel(for 循环对结果进行分页),我需要跳过 for 循环
,我试图跳过此操作,如下所示:
if not wordExport then
response.Write "test"
for J = 1 to RSList.PageSize
end if
更多代码此处显示全部来自数据库的信息。(由于用户选择了“导出”,因此没有分页)
if not wordExport then
RSList.movenext
next
end if
但是,我不断收到以下错误:
Microsoft VBScript compilation error '800a0400'
Expected statement
end if
^
我缺少什么吗???我没看到……啊啊啊。帮助!
I have a classic asp application, and i need to skip a for loop if the user has chosen to export this report into excel (the for loop paginates the results)
i'm trying to skip this, like so:
if not wordExport then
response.Write "test"
for J = 1 to RSList.PageSize
end if
more code here display all the information from the database.(without pagination since the user has picked "export")
if not wordExport then
RSList.movenext
next
end if
however, i keep getting the following error:
Microsoft VBScript compilation error '800a0400'
Expected statement
end if
^
is there something i'm missing??? i don't see it... aaah. help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我必须采取一种解决方法(这会导致大量冗余代码),
其中这两个子程序完全相同,除了一个以 20(页面大小)增量循环,另一个循环遍历整个数据集。
i had to do a workaround (which cause lots and lots of redundant code)
where these two subs are exactly the same, except one loops in increments of 20 (page size), and the other loops through the whole dataset.
是的,您甚至一开始就没有合适的 FOR 循环。
Yes, you don't even have a proper FOR loop to begin with.
您是否缺少 Next J 语句?
are you missing a Next J statement?
我认为在
for
循环之后您可能需要一个Next
I think you might need a
Next
after yourfor
loop