Get Column Names for GetRows

Results 1 to 2 of 2

Thread: Get Column Names for GetRows

  1. #1
    Join Date
    Dec 1969

    Default Get Column Names for GetRows

    I have a user-created SQL statement that can return a recordset which varies in number of rows and columns. I used GetRows to put the recordset in an array and Ubound to find out how many columns and rows to put in my html table.<BR><BR>My question is: how do I get the column names for a heading row in my table?

  2. #2
    Join Date
    Dec 1969

    Default RE: Get Column Names for GetRows

    BEFORE you do the RS.GetRows, do:<BR><BR>&#060;%<BR>Dim columnNames( )<BR>colCount = RS.Fields.Count<BR>ReDim columnNames(colCount)<BR>For colNum = 0 To colCount - 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;columnNames(colNum) = RS.Fields(colNum).Name<BR>Next<BR>&#039<BR>&#039 *now* you can do your ...<BR>theArray = RS.GetRows<BR>%&#062;<BR><BR>You could, of course, dump them directly out to HTML instead of putting them in the array. Your choice.<BR><BR>

Posting Permissions

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