首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

这段ASP的代码怎么改成VB的呢,用什么方法都可以,越简单越好

2012-10-05 
这段ASP的代码如何改成VB的呢,用什么方法都可以,越简单越好。HTML codedim idim ji 0j 0Do While j 4

这段ASP的代码如何改成VB的呢,用什么方法都可以,越简单越好。

HTML code
         dim i    dim j    i = 0    j = 0    Do While j < 42        Set rs=Conn.execute("select a,c,d,e from table1 where UserID='000'")        If Rs("a") >= 0 Then            Set rs1=Game.execute("select b from Table2 where ID="&rs("id"))            If Not rs1.eof Then                    response.write("<tr >")                    response.write("<td>"&(j+1)&"</td>")                    response.write("<td>"&rs("a")&"</td>")                    response.write("<td>"&rs1("b")&"</td>")                    response.write("<td>"&rs("c")&"</td>")                    response.write("<td>"&rs("d")&"</td>")                    response.write("<td>"&rs("e")&"</td>")                response.write("</tr>")            Else                response.write("<tr>")                    response.write("<td>"&(j+1)&"</td>")                    response.write("<td> "&rs("a")&"</td>")                response.write("</tr>")            End If            rs1.close        End If        j = j + 1        i = i + 8        rs.Close    Loop    End if


[解决办法]
部件添加mshflexgrid控件,然后大体如下,细节自已改吧:
VB code
Private Sub Form_Load()Dim iDim j    i = 0    j = 0    MSHFlexGrid1.Cols = 6    MSHFlexGrid1.Rows = 43    MSHFlexGrid1.FixedCols = 0    Do While j < 42        Set rs = Conn.Execute("select a,c,d,e from table1 where UserID='000'")        If rs("a") >= 0 Then            Set rs1 = Game.Execute("select b from Table2 where ID=" & rs("id"))                    MSHFlexGrid1.TextMatrix(j, 0) = j + 1            If Not rs1.EOF Then                    MSHFlexGrid1.TextMatrix(j, 1) = rs("a")                    MSHFlexGrid1.TextMatrix(j, 2) = rs1("b")                    MSHFlexGrid1.TextMatrix(j, 3) = rs("c")                    MSHFlexGrid1.TextMatrix(j, 4) = rs("d")                    MSHFlexGrid1.TextMatrix(j, 5) = rs("e")            Else                    MSHFlexGrid1.TextMatrix(j, 1) = rs("a")            End If            rs1.Close        End If        j = j + 1        i = i + 8        rs.Close    Loop    End IfEnd Sub 

热点排行