|
-
Jul 19th, 2001, 10:04 AM
#1
Thread Starter
Hyperactive Member
Well it sounds simple enough
Does anyone know of any ADO or SQL to list the table name contents of a database?
Regards Gary
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
-
Jul 19th, 2001, 10:41 AM
#2
Black Cat
You want to use the OpenSchema method of a Connection object. I haven't used it, so I don't have an example, but this is from MSDN:
The OpenSchema method returns self-descriptive information about the data source, such as what tables are in the data source, the columns in the tables, and the data types supported.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jul 19th, 2001, 10:43 AM
#3
Thread Starter
Hyperactive Member
Have an example line of code Jo
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
-
Jul 19th, 2001, 11:43 AM
#4
Thread Starter
Hyperactive Member
Someone sent me this "select * from sysobjects" shed any light.??
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
-
Jul 19th, 2001, 11:55 AM
#5
Black Cat
http://msdn.microsoft.com/library/de...openschema.asp
There's a link to VB sample code at the end of the page.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jul 19th, 2001, 11:57 AM
#6
Thread Starter
Hyperactive Member
Read through that, it dont work. ASP Pages these are. If theres no SQL statement to do it, how can anything else?
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
-
Jul 19th, 2001, 12:15 PM
#7
Black Cat
This code worked beautifully for me. Just convert it to ASP and you're set. You don't need SQL statements to get data out of a database, they're just one way of doing it.
VB Code:
Dim c As ADODB.Connection
Dim rs As ADODB.Recordset
Set c = New ADODB.Connection
c.Open "Provider=SQLOLEDB;Server=SQLServer2000;Database=MyDatabase;Trusted_Connection=Yes;"
Set rs = c.OpenSchema(adSchemaTables)
Do While Not rs.EOF
Debug.Print rs.Fields("TABLE_NAME")
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
c.Close
Set c = Nothing
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jul 20th, 2001, 04:30 AM
#8
Thread Starter
Hyperactive Member
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|