J
Jack
Hi,
I got a code that is supposed to build first column as blank and then columns
corresponding to the query. However, the final result is coming with one
extra column where the vendor code values goes into the extra column while
the Vendor Code column is blank. Appreciate any help.
Thanks
CODE:
%@ Language=VBScript %>
<HTML>
<TITLE> Table Procedure </TITLE>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
'Procedure to create a table
Sub MakeTable(sourcein, dsnin)
Dim oRSmt
Set oRSmt = Server.CreateObject("ADODB.Recordset")
oRSmt.Open sourcein, "DSN=" & dsnin
oRSmt.MoveFirst
Response.Write "<TABLE BORDER = 1><TR>"
Response.Write "<TH>" & " </TH>"
For Each objField in oRSmt.Fields
Response.Write "<TH>" & objField.name & "</TH>"
Next
Do While Not oRSmt.EOF
Response.Write "<TR>"
For Each obFld in oRSmt.Fields
Response.Write "<TD>" & " </TD>"
Response.Write "<TD>" & obFld.value & " </TD>"
Next
oRSmt.MoveNext
Response.Write "</TR>"
Loop
Response.Write "</TABLE>"
oRSmt.Close
Set oRSmt = Nothing
End Sub
%>
<%call MakeTable("Select VendorName, VendorCode from Vendors
where VendorCode = 'ph'", "Clothiers")%></P>
</BODY>
</HTML>
I got a code that is supposed to build first column as blank and then columns
corresponding to the query. However, the final result is coming with one
extra column where the vendor code values goes into the extra column while
the Vendor Code column is blank. Appreciate any help.
Thanks
CODE:
%@ Language=VBScript %>
<HTML>
<TITLE> Table Procedure </TITLE>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
'Procedure to create a table
Sub MakeTable(sourcein, dsnin)
Dim oRSmt
Set oRSmt = Server.CreateObject("ADODB.Recordset")
oRSmt.Open sourcein, "DSN=" & dsnin
oRSmt.MoveFirst
Response.Write "<TABLE BORDER = 1><TR>"
Response.Write "<TH>" & " </TH>"
For Each objField in oRSmt.Fields
Response.Write "<TH>" & objField.name & "</TH>"
Next
Do While Not oRSmt.EOF
Response.Write "<TR>"
For Each obFld in oRSmt.Fields
Response.Write "<TD>" & " </TD>"
Response.Write "<TD>" & obFld.value & " </TD>"
Next
oRSmt.MoveNext
Response.Write "</TR>"
Loop
Response.Write "</TABLE>"
oRSmt.Close
Set oRSmt = Nothing
End Sub
%>
<%call MakeTable("Select VendorName, VendorCode from Vendors
where VendorCode = 'ph'", "Clothiers")%></P>
</BODY>
</HTML>