这段ASP的代码如何改成VB的呢,用什么方法都可以,越简单越好。
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
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