Retrieving Table Properties

The Properties collection of an ADOX Table object allows you to set or retrieve table properties. The Properties collection exposes standard ADO properties as well as properties specific to the data provider. The following procedure accesses the table called tblFilters and lists its properties and their values in the Immediate window.

© Hands-On 11-6: Listing Table Properties

1. In the Visual Basic Editor window, choose Insert | Module.

2. In the module's Code window, type the List_TableProperties procedure shown below.

3. Choose Run | Run Sub/UserForm to execute the procedure.

Sub List_TableProperties() Dim cat As ADOX.Catalog Dim tbl As ADOX.Table Dim pr As ADOX.Property

Set cat = New ADOX.Catalog

Set cat.ActiveConnection = CurrentProject.Connection

Set tbl = cat.Tables("tblFilters")

' retrieve table properties For Each pr In tbl.Properties Debug.Print tbl.Name & ": " & _ pr.Name & "= "; pr.Value


Set cat = Nothing End Sub

Temporary Table: raise *

Jet OLEDB:Table Ualidation Text = Jet OLEDBiTable Ualidation Rule= Jet OLEDBCache Link Name/Password= False Jet OLEDB:Remote Table Name= Jet OLEDB:Link Provider String= Jet OLEDB:Link Datasource= Jet OLEDB:Exclusive Link: False Jet OLEOB:Create Link: Falss Jet OLEDB:Table Hidden In Access= False d

Figure 11-4: You can list the names of table properties and their values programmat-ically as shown in Hands-On 11-6.

Creating and Manipulating Databases with ADO

0 0

Post a comment