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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table/View Descriptions 2

Status
Not open for further replies.

bklyn3801

MIS
Feb 10, 2004
2
US
I'm using Access as my client and SQL Server for my data and I was wondering if anyone knew how I can get my table/stored procedure descriptions to show on my client. All I get are dbo names and types but nothing in description or date created. Any suggestions?
 
You can do it through VBA code. Here is an example. Check out the various collections in the Catalog. This example is looking at the Table Collection.


Function catalogTC()
'-- set reference to ADOX library
'- Microsoft ADO Ext. 2.6 for DDL and Security
'-- Microsoft ActiveX data objects 2.6 library also needed for ADO

Dim cg As New ADOX.Catalog
Dim tb As New ADOX.Table
Dim cn As adodb.Connection
Dim cl As Column
Dim pp As Property

Set cg.ActiveConnection = CurrentProject.Connection

For Each tb In cg.Tables
Debug.Print "table name = "; "-------"; tb.Name; "--------"; tb.Type

' If tb.Type = "TABLE" Then
' If tb.Type = "LINK" Then
' For Each pp In tb.Properties
' Debug.Print "property name = "; pp.Name
' Debug.Print "property value = "; pp.Value
' Next

If (tb.Type = "TABLE" And tb.Name = "Categorys") Then
For Each cl In tb.Columns
Debug.Print "name = "; cl.Name
For Each pp In cl.Properties
Debug.Print "property name = "; pp.Name
Debug.Print "property value = "; pp.Value
Next
Next
End If
Next

End Function
 
Thanks for your help. Sorry, I'm pretty new to this. What catalogs are you referring to?
 
ADOX treats the various meta data in the source it is connected to, as a catalog with collections of items. So, tables, views, fields and such are collections in the ADOX catalog. The catalog is an ADOX term in reference to the source, in this case, the Access program as indicated by the "Set cg.ActiveConnection = CurrentProject.Connection".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top