SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Threaded View

  1. #1
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL Query String... getting field headers

    hey guys,

    I've got an ASP-SQL query as follows:

    <%
    <!--#include file="inc-dbconnection.asp"--> <% 'connect to a d/base
    Set objRS = objConn.Execute (SQLcode) %>

    <table cellpadding=5 border=1>
    <tr>
    <td><b>STD_ID</b></td>
    <td><b>STD_FNAME<b></td>
    <td><b>STD_MNAME</b></td>
    <td><b>STD_LNAME</b></td>
    <td><b>STD_FACULTY</b></td>
    <td><b>STD_COMMITMENT</b></td>

    </tr>

    <%Do While Not objRS.EOF%>
    <tr>
    <td><%=objRS("STD_ID")%></td>
    <td><%=objRS("STD_FNAME")%> </td>
    <td><%=objRS("STD_MNAME")%> </td>
    <td><%=objRS("STD_LNAME")%> </td>
    <td><%=objRS("STD_FACULTY")%> </td>
    <td><%=objRS("STD_COMMITMENT")%> </td>
    </tr>
    <% objRS.MoveNext
    Loop
    objRS.Close

    </table> %>

    The problem now is that I've got to manually type in the field headers into my table. Is there a way to have the query return the SELECTed statements, as well as all related field headers?
    Last edited by infinitium; Jan 17, 2002 at 04:12.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •