Can't see a database table's attributes 
Author Message
 Can't see a database table's attributes

I have a bit of code using ADO technology that will allow
me to list a database's tables. I'm currently using MS-
Access databases for testing at the moment. The code is:

Set rstTables = cnnMainDb.OpenSchema(adSchemaTables)
   With rstTables
      Do Until .EOF
         lstDbTables.AddItem !TABLE_NAME & " " & !  
TABLE_TYPE
         .MoveNext
      Loop
   End With
This will list ALL the tables in the selected Access
database, including the System and Hidden tables. I do
not want to list any system or hidden tables. Does ADO
allow the programmer the ability to read a database
table's attributes? If so How can I read it?

Thank you



Mon, 28 Nov 2005 22:04:47 GMT  
 Can't see a database table's attributes
Hi Mark,

I think TABLE_TYPE field will contain information if it is system table or
not

--
Val Mazur
Microsoft MVP


Quote:
> I have a bit of code using ADO technology that will allow
> me to list a database's tables. I'm currently using MS-
> Access databases for testing at the moment. The code is:

> Set rstTables = cnnMainDb.OpenSchema(adSchemaTables)
>    With rstTables
>       Do Until .EOF
>          lstDbTables.AddItem !TABLE_NAME & " " & !
> TABLE_TYPE
>          .MoveNext
>       Loop
>    End With
> This will list ALL the tables in the selected Access
> database, including the System and Hidden tables. I do
> not want to list any system or hidden tables. Does ADO
> allow the programmer the ability to read a database
> table's attributes? If so How can I read it?

> Thank you




Mon, 28 Nov 2005 22:10:49 GMT  
 Can't see a database table's attributes
It shows a system type. It will not show is a table is
hidden. This remains a problem.

Thank you,
Mark McCumber

Quote:
>-----Original Message-----
>Hi Mark,

>I think TABLE_TYPE field will contain information if it
is system table or
>not

>--
>Val Mazur
>Microsoft MVP



>> I have a bit of code using ADO technology that will
allow
>> me to list a database's tables. I'm currently using MS-
>> Access databases for testing at the moment. The code
is:

>> Set rstTables = cnnMainDb.OpenSchema(adSchemaTables)
>>    With rstTables
>>       Do Until .EOF
>>          lstDbTables.AddItem !TABLE_NAME & " " & !
>> TABLE_TYPE
>>          .MoveNext
>>       Loop
>>    End With
>> This will list ALL the tables in the selected Access
>> database, including the System and Hidden tables. I do
>> not want to list any system or hidden tables. Does ADO
>> allow the programmer the ability to read a database
>> table's attributes? If so How can I read it?

>> Thank you

>.



Mon, 28 Nov 2005 22:54:15 GMT  
 Can't see a database table's attributes

I have a bit of code using ADO technology that will allow
me to list a database's tables. I'm currently using MS-
Access databases for testing at the moment. The code is:

Set rstTables = cnnMainDb.OpenSchema(adSchemaTables)
   With rstTables
      Do Until .EOF
         lstDbTables.AddItem !TABLE_NAME & " " & !  
TABLE_TYPE
         .MoveNext
      Loop
   End With
This will list ALL the tables in the selected Access
database, including the System and Hidden tables. I do
not want to list any system or hidden tables. Does ADO
allow the programmer the ability to read a database
table's attributes? If so How can I read it?

You have to use ADOX (Microsoft ADO Ext 2.x for DDL and Security) if you want to determine whether a
table is hidden in Access:

Dim cat As New ADOX.Catalog
Dim tbl As ADOX.Table

cat.ActiveConnection = _
   "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=e:\My Documents\db1.mdb;" & _
   "Jet OLEDB:Engine Type=4"

For Each tbl In cat.Tables
    If tbl.Properties("Jet OLEDB:Table Hidden In Access").Value = True Then
        Debug.Print "Name: " & tbl.NAME & " Type: " & tbl.Type & " Hidden: YES"
    Else
        Debug.Print "Name: " & tbl.NAME & " Type: " & tbl.Type & " Hidden: NO"
    End If
Next

Set cat = Nothing


Microsoft MVP (Visual Basic)



Mon, 28 Nov 2005 23:43:12 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. 'Canned' data in VB program

2. CreateTableDef 'attributes' option

3. Can't identify 'Scope' or 'Headers' attributes in DOM object

4. Can't see tables in database

5. **************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Help me !!!!!!!!!!!!!!!!!!!!!!!!'''''''''''''''''''''''*************

6. Creating database's an tables

7. Table won't append to database

8. getting a table list from Access'97 database

9. Quest.: About NULL's in database tables

10. Creating database's an tables

11. Secured MSAccess Database - Can't access new table

12. Linking a dBase III table to an Access 2000 database - won't open

 

 
Powered by phpBB® Forum Software