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' 

解决方案 »

  1.   

    vb的不懂,怎么发到C#论坛来了
      

  2.   

    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 
      

  3.   

    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
      

  4.   

    。vb for循环没有end
    快忘干净了
      

  5.   

    如3楼所说,在for循环中少了end