Function错误

jiangpingchang 2008-06-05 09:47:56
Function ProTest(UserID)
dim rs, sql
set rs = Server.CreateObject("adodb.recordset")
sql = "select paytype from Cl_User where userid= "&UserID&""
rs.open sql, conn, 1, 1

dim paytype, arr
paytype = rs("paytype")
arr = split(paytype,",")

dim i, rsp, sqlp, FinishDate, inpaytype, outpaytype
for i = lbound(arr) to ubound(arr) step 1
set rsp = Server.CreateObject("adodb.recordset")
sqlp = "select top 1 FinishDate from Cl_PayLog where userid = "&UserID&" and ProId = "&arr(i)&" order by FinishDate desc"
rsp.open sqlp, conn, 1, 1

if rsp.eof or rsp.bof then
outpaytype=outpaytype + arr(i) + ","
else
if Datediff("d",rsp("FinishDate"),now())<=0 then
inpaytype = arr(i)+ ","
else
outpaytype = arr(i)+","
end if
end if
rsp.close
set rsp = nothing
next

rs.close
set rs =nothing
Response.Write("您的以下产品还可以使用,<br>")
Response.Write(inpaytype&"<br>")
Response.Write("您的以下产品已经过期<br>")
Response.Write(outpaytype)
End Function这段代码在哪里有错误啊?
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'
...全文
105 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
dreamsnake 2008-06-05
  • 打赏
  • 举报
回复
把格式对齐做好,细心点儿,一定能找出来的
jiangpingchang 2008-06-05
  • 打赏
  • 举报
回复
还是不行
abchappybear 2008-06-05
  • 打赏
  • 举报
回复
如3楼所说,在for循环中少了end
ericzhangbo1982111 2008-06-05
  • 打赏
  • 举报
回复
。。。。vb for循环没有end
快忘干净了
ericzhangbo1982111 2008-06-05
  • 打赏
  • 举报
回复
for i = lbound(arr) to ubound(arr) step 1
set rsp = Server.CreateObject("adodb.recordset")
sqlp = "select top 1 FinishDate from Cl_PayLog where userid = "&UserID&" and ProId = "&arr(i)&" order by FinishDate desc"
rsp.open sqlp, conn, 1, 1

if rsp.eof or rsp.bof then
outpaytype=outpaytype + arr(i) + ","
else
if Datediff("d",rsp("FinishDate"),now()) <=0 then
inpaytype = arr(i)+ ","
else
outpaytype = arr(i)+","
end if
end if
rsp.close
set rsp = nothing
next
end
for 循环少了end
ericzhangbo1982111 2008-06-05
  • 打赏
  • 举报
回复
if rsp.eof or rsp.bof then
outpaytype=outpaytype + arr(i) + ","
else
if Datediff("d",rsp("FinishDate"),now()) <=0 then
inpaytype = arr(i)+ ","
else
outpaytype = arr(i)+","
end if
end if

rsp.close
set rsp = nothing
next
xiandawang 2008-06-05
  • 打赏
  • 举报
回复
vb的不懂,怎么发到C#论坛来了

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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