B
bart plessers
Hello,
below you will find a simple script that reads out info of a dbase
It reads out all the records and every field of the record.
For my table header, I want to display the field names of the table
can ASP extract this information? How? What is the correct syntax?
tia
bartp
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open CONN_STRING
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open SQL, Conn, adOpenStatic, adLockReadOnly, adCmdText
iRecords = RS.RecordCount
iFields = RS.Fields.Count
%>
<table border="1" align="center">
<TR bgcolor="#CCCCCC">
<%For j = 0 To iFields-1 %>
<TD><%response.Write(" ")%></TD> --------> this should be
modified to display the table header
<%Next 'j%>
</TR>
<%For i = 0 To iRecords-1 %>
<TR>
<%For j = 0 To iFields-1 %>
<TD><%response.Write(RS.Fields(j))%></TD>
<%Next 'j%>
</TR>
<%RS.MoveNext%>
<%Next 'i%>
</table>
<%
RS.Close
Set RS = Nothing
Conn.Close
Set Conn = Nothing
%>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
==========================================
Hyper A.R.T.
bart plessers
Paul Van Ostaijenlaan 4
3001 Heverlee
BELGIUM
tel: +32 (16) 23.40.85
fax: +32 (16) 23.41.06
==========================================
below you will find a simple script that reads out info of a dbase
It reads out all the records and every field of the record.
For my table header, I want to display the field names of the table
can ASP extract this information? How? What is the correct syntax?
tia
bartp
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open CONN_STRING
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open SQL, Conn, adOpenStatic, adLockReadOnly, adCmdText
iRecords = RS.RecordCount
iFields = RS.Fields.Count
%>
<table border="1" align="center">
<TR bgcolor="#CCCCCC">
<%For j = 0 To iFields-1 %>
<TD><%response.Write(" ")%></TD> --------> this should be
modified to display the table header
<%Next 'j%>
</TR>
<%For i = 0 To iRecords-1 %>
<TR>
<%For j = 0 To iFields-1 %>
<TD><%response.Write(RS.Fields(j))%></TD>
<%Next 'j%>
</TR>
<%RS.MoveNext%>
<%Next 'i%>
</table>
<%
RS.Close
Set RS = Nothing
Conn.Close
Set Conn = Nothing
%>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
==========================================
Hyper A.R.T.
bart plessers
Paul Van Ostaijenlaan 4
3001 Heverlee
BELGIUM
tel: +32 (16) 23.40.85
fax: +32 (16) 23.41.06
==========================================