本文實例講述了VB傳回記錄集結果到HTML表格的方法。分享給大家供大家參考。具體實作方法如下:
function ReturnHTMLTable(query) set rs = cn.Execute(query) rs.MoveFirst response.Write "<tabledata"" cols=""" & rs.Fields.Count & """>" response.Write "<tr>" For Each oField In rs.Fields response.Write "<th>" & oField.Name & "</th>" Next response.Write "</tr>" Do While Not rs.EOF response.Write "<tr>" For Each oField In rs.Fields response.Write "<td>" If IsNull(oField) Then response.Write " " Else response.Write oField.Value End If response.Write "</td>" Next rs.MoveNext response.Write "</tr>" Loop response.Write "</table>"end function
希望本文所述對大家的VB程式設計有幫助。