...

View Full Version : Showing DB Tables and Their Contents



ldiuf
08-05-2002, 07:18 PM
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:thumbsup:

Roelf
08-05-2002, 09:45 PM
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.

ldiuf
08-06-2002, 02:15 AM
actually it's a MS Access DB

ldiuf
08-07-2002, 10:01 PM
Anybody?

whammy
08-07-2002, 11:35 PM
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...

ldiuf
08-09-2002, 12:10 AM
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?

:thumbsup:

whammy
08-09-2002, 03:37 AM
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...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum