Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 17th, 2003, 11:27 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default Return a Record set into a table?

If I am using a while wend loop to return only the records I want from the Database(MS Access) can I use those values to fill in a table. Or do I have to use the The fields Collection.
I retrive the records I want with the below script, the connection and everything is already made. But can I take those valuse and use them in a table. Also I need it to display all records in the fields I want so if I add or delete it will change with the DB. Any help would be great, Thanks!!!!

While Not objRecordset.EOF
    Response.Write objRecordset("ISBN")
 objRecordset.MoveNext
wend

__________________
-----------------------------------------------------------
\"Don\'t follow someone who\'s not going anywhere\" John Mason
Reply With Quote
  #2 (permalink)  
Old November 17th, 2003, 11:38 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I just dumped this out of my head, but it should more or less work.

If Not objRecordset.EOF Then
    Response.Write("<table>")
    Response.Write("<tr>")
    For Each objField In objRecordset.Fields
        Response.Write("<td>" & objField.Name & "</td>")
    Next
    Response.Write("</tr>")
    While Not objRecordset.EOF
        Response.Write("<tr>")
        For Each objField In objRecordset.Fields
            Response.Write("<td>" & objRecordset(objField.Name) & "</td>")
        Next
        Response.Write("</tr>")
        objRecordset.MoveNext
    Wend
    Response.Write("</table>")
End If


Peter
------------------------------------------------------
Work smarter, not harder.
Reply With Quote
  #3 (permalink)  
Old November 18th, 2003, 11:38 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return one record per value fizzerchris SQL Server 2005 4 August 17th, 2007 09:31 PM
Return a record that doesn't exist in a table? Unregistered SQL Server 2000 4 May 3rd, 2006 01:27 AM
return record count by quarter jtyson SQL Server 2000 1 June 29th, 2004 11:24 PM
Return the last record altered MikeJames42 VB How-To 1 February 13th, 2004 12:57 PM
Forms -- how to return to the same record and fiel tcarnahan Access 1 June 10th, 2003 11:24 AM



All times are GMT -4. The time now is 05:11 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.