Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting all the tables from SQL Server?

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
Hi all,

Does anybody know how I can simply get all the table names from a database in SQL Server? without using a stored procedure?

thanks in advance

Mel
 
Set references to MS ADO 2.x, and MS ADO Extensions for Security. Then play with this code...

Dim cnn As New ADODB.Connection
Dim cat As New ADOX.Catalog
Dim tbl As ADOX.Table

cnn.Open "Yourconnectionstring"
cat.ActiveConnection = cnn

For Each tbl In cat.Tables
List1.AddItem tbl.Name
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top