Jul 24, 2001 #1 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
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
Jul 24, 2001 #2 Niv3k Programmer Jul 11, 2001 350 US 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 Upvote 0 Downvote
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