小编sae*_* ek的帖子

VBScript没有超过if语句

我有一个简单VBScript的从数据库获取数据并迭代它们并生成一个表.在此迭代期间,我想捕获一些数据(特定列的值)并将它们保存在变量中供以后使用.但是每当我的代码到达那个if语句时,它就不再循环了.

  Dim lats
  Dim longs
  Set lats = CreateObject("System.Collections.ArrayList")
  Set longs = CreateObject("System.Collections.ArrayList")
  %>
  <table>
    <tr><th>Office</th><th>Address</th><th>Comune</th><th>Province</th><th>Lat</th><th>Long</th><th>2G</th><th>3G</th><th>4G</th></tr>

    <%do until rs.EOF
        response.write("<tr>")
        for each x in rs.Fields
          response.write("<td>" & response.write(x.value) &"</td>")
          'IF the below statement equals true, the loop doesn't perform anymore
          If x.name = "SITE_LAT_N" Then
            lats.Add x.value
          ElseIf x.name = "SITE_LON_E" Then
            longs(indx) = x.value
          End If
          next
        rs.MoveNext
        response.write("</tr>")
      loop
      rs.close
      conn.close
      %>
    </table>
Run Code Online (Sandbox Code Playgroud)

html vbscript asp-classic

-1
推荐指数
1
解决办法
75
查看次数

标签 统计

asp-classic ×1

html ×1

vbscript ×1