%@ LANGUAGE = VBScript %>
<% Option Explicit %>
Query to Fill HTML Table (using ADO Table Component)
Query to Fill HTML Table
<%
Dim oConn
Dim oRs
Dim curDir
Dim nIndex
Dim varTemp
dim nFieldCount
nFieldCount = 0
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=WMIOLEDB;Data Source=Root/CIMV2"
Set oRs = Server.CreateObject("ADODB.Recordset")
Set oRS.ActiveConnection = oConn
oRs.CursorType = 0
oRs.LockType = 1
oRs.Open "Win32_LogicalDisk", , ,,2
nFieldCOunt = oRs.Fields.Count
response.write ""
nIndex = 0
Response.Write ""
while nIndex < nFieldCount
Response.write "" & CStr(oRs(nIndex).Name) & " | "
nIndex = nIndex + 1
Wend
Response.Write ""
Response.write ""
while( oRs.Eof <> True)
nIndex = 0
while nIndex < nFieldCount
varTemp = oRs(nIndex).Value
If( IsArray(varTemp) = True) then
Response.write "" & "*ARRAY" & " | "
Else
If ( IsNull(varTemp) = True) then
Response.write "" & "**NULL" & " | "
Else
Response.write "" & CStr(varTemp) & " | "
End If
End If
nIndex = nIndex + 1
wend
oRs.MoveNext
Response.write ""
wend
Response.Write "
"
Response.Write " *ARRAY - Property is of type Array
"
Response.Write "**NULL - Property Value is NULL
"
%>