Article ID: 199233
Article Last Modified on 6/23/2005
strSQL = "SELECT * FROM <Table Name>"
RS.Open strSQL, "DSN=<Datasource Name>"
<html>
<head><title>DHTML and ASP Example</title></head>
<body>
<h3 id="HideMe">Please wait while the data loads...</h3>
<%
Dim RS, strSQL, i
Set RS = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM Products"
RS.CursorType = 1 ' open with adOpenKeyset
RS.Open strSQL, "DSN=AdvWorks"
If Not RS.EOF Then
Response.Write "<table border=1>" & vbCrLf
Response.Write "<tr>"
For i = 0 to (RS.Fields.Count - 1)
Response.Write "<th>" & RS.Fields(i).Name & "</th>"
Next
Response.Write "</tr>" & vbCrLf
Do While Not RS.EOF
Response.Write "<tr>"
For i = 0 to (RS.Fields.Count - 1)
Response.Write "<td>" & RS.Fields(i).Value & "</td>"
Next
Response.Write "</tr>" & vbCrLf
RS.MoveNext
Loop
Response.Write "</table>" & vbCrLf
End If
%>
<script language="JavaScript" for="window" event="onload">
HideMe.innerText='<%=RS.RecordCount%> Record(s) displayed.'
</script>
<% RS.Close %>
</body>
</html>
HideMe.style.display='none';
Additional query words: jscript javascript scripting dhtml asp html
Keywords: kbhowto KB199233