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!

Accessing table metadata

Status
Not open for further replies.

JoeSmoe55

Programmer
Aug 1, 2005
38
US
Hello all,

happy new year!! I am wanting to programatically access table and column metadata ( i.e. data type, length (if integer), is it a primary key, such and so forth...). Is it possible? My assumption is that it is but I don't know what keywords to use in help. Metadata doesn't work. thanks.

Joe
 
I think the word you want is TableDef.

 
yep I found out how to do it already by looking in the good 'ol object browser. Sorry I must not have looked too hard. Thanks Remou.

For those interested - here's a simple example.

Dim td As TableDef, f As Field

For Each td In CurrentDb.TableDefs
With td
For Each f In .Fields
MsgBox .Name & "." & f.Name & " is a " & IIf(f.Type = dbText, "String", "Not a String")
Next f
End With
Next td
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top