Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Posts
    20

    Wink Unanswered: formatting sql recordset

    Dear All,

    I have some SQL data which I want to format using VBScript on an ASP page. The SQL data is like this:

    FieldName data1
    FieldName data2
    FieldName data3
    FieldName data4

    I want to format the front-end code so it reads like this:

    FieldName data1
    data2
    data3
    data4

    Can anyone help?

    Cheers

    Gill

  2. #2
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    What is the problem your having?

    Is it that you do not know where to start? If so, read the ASP guide on http://www.w3schools.com to save us having to explain it again. Or use Google.

    It would be something like this
    Code:
    'create and open the rs
    while not(rs.eof or rs.bof)
     for x=1 to 4
       if x=1 then
        response.write rs.fields(1).name & " "
      end if
      response.write rs.fields(x).value & "<br />"
     next
     rs.movenext
    endw
    'close rs and set to nothing
    Last edited by rhs98; 05-06-03 at 09:06.

Posting Permissions

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