$#@60;table$#@62;
$#@60;% For Each fld in rs.Fields %$#@62;
$#@60;th$#@62;$#@60;% = fld.Name %$#@62;$#@60;/th$#@62;
$#@60;%
Next
While Not rs.EOF
%$#@62;
$#@60;tr$#@62;
$#@60;% For Each fld in rs.Fields %$#@62;
$#@60;td$#@62;$#@60;% = fld.Value %$#@62;$#@60;/td$#@62;
$#@60;% Next
$#@60;/tr$#@62;
$#@60;% rs.MoveNext
Wend %$#@62;
$#@60;/table$#@62;
下面是更有效率的代码,每行一个输出:
$#@60;table$#@62;
$#@60;%
For each fld in rs.Fields
Response.Write ("$#@60;th$#@62;" & fld.Name & "$#@60;/th$#@62;" & vbCrLf)
Next
While Not rs.EOF
Response.Write ("$#@60;tr$#@62;")
For Each fld in rs.Fields %$#@62;
Response.Write("$#@60;td$#@62;" & fld.Value & "$#@60;/td$#@62;" & vbCrLf)
Next
Response.Write "$#@60;/tr$#@62;"
Wend
%$#@62;
$#@60;/table$#@62;
s = "$#@60;table$#@62;" & vbCrLf
For Each fld in rs.Fields
s = s & " $#@60;th$#@62;" & fld.Name & "$#@60;/th$#@62; "
Next
While Not rs.EOF
s = s & vbCrLf & " $#@60;tr$#@62;"
For Each fld in rs.Fields
s = s & " $#@60;td$#@62;" & fld.Value & "$#@60;/td$#@62; "
Next
s = s & " $#@60;/tr$#@62;"
rs.MoveNext
Wend
s = s & vbCrLf & "$#@60;/table$#@62;" & vbCrLf
Response.Write s