Forums
This topic is locked
Enumerate MS SQL Database Objects...
Posted 31 Mar 2004 22:31:50
1
has voted
31 Mar 2004 22:31:50 Dave Blohm posted:
Does anyone have a routine to show all tables (or other objects) in an MS SQL database?Thanks in advance
Doc
Rangewalk Digital Studios
Replies
Replied 31 Mar 2004 22:37:59
31 Mar 2004 22:37:59 Dave Blohm replied:
Found it...
DataString = "Provider=SQLOLEDB;Data Source=ac-sql1;User ID=myUser;Password=myPassword" Set Connection = Server.CreateObject("ADODB.Connection"
Connection.Open DataString
Set adoxConn = Server.CreateObject("adox.catalog"
adoxConn.activeConnection = Connection
Set Table = adoxConn.Tables
For Each col In Table
If UCase(col.Type)="TABLE" Then
%>
<%= col.Name %><br>
<%
End If
Next
Set Table = Nothing
Set adoxConn = Nothing
Doc
Rangewalk Digital Studios
Edited by - on 31 Mar 2004 22:38:20
DataString = "Provider=SQLOLEDB;Data Source=ac-sql1;User ID=myUser;Password=myPassword" Set Connection = Server.CreateObject("ADODB.Connection"
Connection.Open DataString
Set adoxConn = Server.CreateObject("adox.catalog"
adoxConn.activeConnection = Connection
Set Table = adoxConn.Tables
For Each col In Table
If UCase(col.Type)="TABLE" Then
%>
<%= col.Name %><br>
<%
End If
Next
Set Table = Nothing
Set adoxConn = Nothing
Doc
Rangewalk Digital Studios
Edited by - on 31 Mar 2004 22:38:20