Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 18th, 2004, 11:30 PM
Authorized User
 
Join Date: Mar 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default Selecting and Making a table

I have a database that has a bunch of words in it... It changes all the time though. I need to be able to select all the words from it and arrange it in a table. But I have NO clue how to make the table the way i want.

Table Design:
Word1 Word6
Word2 Word7
Word3 Word8
Word4 Word9
Word5

If anyone knows how to do something liekt hat it would be great!

 
Old August 18th, 2004, 11:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Do you mean WORD1-9 are columns in the table? Is that you are looking for selecting values from all those columns and arrange it in one column of a different table?

_________________________
- Vijay G
Strive for Perfection
 
Old August 18th, 2004, 11:58 PM
Authorized User
 
Join Date: Mar 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default

sorry.... I want to select Word1-9 from a column in a database, and arrange them in a ASP page, that looks like this:

ASP Page Table Design:
Word1 Word6
Word2 Word7
Word3 Word8
Word4 Word9
Word5

 
Old August 19th, 2004, 12:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Use this logic.

Create connection and recordset objects.
1) open connection
2) contruct select statement as - "select wordcolumnname from tablename order by wordcolumnname"
3) open recordset using the above select statement.
4) Open Table tag, TR tag ad TD tag
5) Declare a counter
6) counter=0
7) Loop through recordset until EOF
    If (counter mod 5) = 0 then
        Response.write "</td>"
        If NOT recordsetobj.EOF then Response.write "<td>"
    End If
    Response.write recordsetobj("wordcolumnname") & "<BR>"
    Counter = counter + 1
    recordsetobj.movenext
8) End loop
9) If (counter mod 5) <> 0 then Response.write "</td>"
10)End TR and Table Tags

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old August 19th, 2004, 10:06 AM
Authorized User
 
Join Date: Mar 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default

That really help! Thanks a lot!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting emails by domain (TLD) from MySQL table? hman MySQL 2 January 11th, 2008 04:32 PM
Making ComboBox to display the List from DB table Bjay VB Databases Basics 1 August 1st, 2007 05:55 PM
Selecting Data from a table nkrust Javascript 7 January 11th, 2007 05:44 AM
Selecting a table name ... quite hard !!! SKE Classic ASP Databases 0 May 16th, 2005 06:23 AM
Making 3 rows become 1 row in another table mcinar SQL Server 2000 10 October 8th, 2004 11:01 PM





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