If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > formatting sql recordset

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-06-03, 06:45
gleech gleech is offline
Registered User
 
Join Date: Dec 2002
Posts: 20
Wink 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
Reply With Quote
  #2 (permalink)  
Old 05-06-03, 08:03
rhs98 rhs98 is offline
Super Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
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 08:06.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On