Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-05-2002, 07:18 PM   PM User | #1
ldiuf
New Coder

 
Join Date: Jun 2002
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
ldiuf is an unknown quantity at this point
Showing DB Tables and Their Contents

Hey,

Is there an easy way to get and show all the contents of a database's tables?

What I've got is a new db structure that has about a hundred tables in it and what I want to do is have a page that shows just the table names and when the name is clicked on it will show the contents of that particular table. I can show the contents just fine I learned that from w3schools. I just need to know how to show the names of the tables first and have them linked to the page that shows the data.

Thanks,
Larry
ldiuf is offline   Reply With Quote
Old 08-05-2002, 09:45 PM   PM User | #2
Roelf
Senior Coder

 
Join Date: Jun 2002
Location: Zwolle, The Netherlands
Posts: 1,110
Thanks: 2
Thanked 28 Times in 28 Posts
Roelf is on a distinguished road
If you're using MS-SQL, there is a table called sysobjects in every database, you can search this table for all tablenames in the database.
Roelf is offline   Reply With Quote
Old 08-06-2002, 02:15 AM   PM User | #3
ldiuf
New Coder

 
Join Date: Jun 2002
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
ldiuf is an unknown quantity at this point
actually it's a MS Access DB
ldiuf is offline   Reply With Quote
Old 08-07-2002, 10:01 PM   PM User | #4
ldiuf
New Coder

 
Join Date: Jun 2002
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
ldiuf is an unknown quantity at this point
Unhappy

Anybody?
ldiuf is offline   Reply With Quote
Old 08-07-2002, 11:35 PM   PM User | #5
whammy
Senior Coder

 
Join Date: Jun 2002
Location: 41° 8' 52" N -95° 53' 31" W
Posts: 3,660
Thanks: 0
Thanked 0 Times in 0 Posts
whammy is an unknown quantity at this point
set rs = conn.Execute("SELECT * FROM testTable")
For Each fld In rs.Fields
response.write fld.Name
response.write " = "
response.write fld.Value
response.write "<br />"
rs.MoveNext
Next
rs.Close

Something like that should work...
__________________
Former ASP Forum Moderator - I'm back!

If you can teach yourself how to learn, you can learn anything. ;)
whammy is offline   Reply With Quote
Old 08-09-2002, 12:10 AM   PM User | #6
ldiuf
New Coder

 
Join Date: Jun 2002
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
ldiuf is an unknown quantity at this point
Yeah, that shows the fields within a specified table, but I'm trying to show a list of all the tables that are contained within the database, mostly.

Any Ideas?

Cheers,
Larry

P.S. Hey, Whammy, where's Dave at he usually has good input on things like this?

ldiuf is offline   Reply With Quote
Old 08-09-2002, 03:37 AM   PM User | #7
whammy
Senior Coder

 
Join Date: Jun 2002
Location: 41° 8' 52" N -95° 53' 31" W
Posts: 3,660
Thanks: 0
Thanked 0 Times in 0 Posts
whammy is an unknown quantity at this point
Oops, I read that wrong! Sorry about that. Never tried to get all the table names.... hmm I'll have to research that one a bit...
__________________
Former ASP Forum Moderator - I'm back!

If you can teach yourself how to learn, you can learn anything. ;)
whammy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:34 PM.


Advertisement
Log in to turn off these ads.