Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 August 18th, 2004, 11:30 PM
Authorized User
 
Join Date: Mar 2004
Location: , , .
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!

Reply With Quote
  #2 (permalink)  
Old August 18th, 2004, 11:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
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
Reply With Quote
  #3 (permalink)  
Old August 18th, 2004, 11:58 PM
Authorized User
 
Join Date: Mar 2004
Location: , , .
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

Reply With Quote
  #4 (permalink)  
Old August 19th, 2004, 12:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
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
Reply With Quote
  #5 (permalink)  
Old August 19th, 2004, 10:06 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
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!

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
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



All times are GMT -4. The time now is 10:28 AM.


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