The example in this article describes the method of VB returning recordset results to HTML tables. Share it with everyone for your reference. The specific implementation method is as follows:
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
I hope this article will be helpful to everyone's VB programming.