[AccessD] Determine if Object is a Table or View

Asger Blond ab-mi at post3.tele.dk
Tue Oct 2 10:20:15 CDT 2007


Try something like this:

If tbl.Type="Table" Then ...
If tbl.Type="View" Then ...

hth
Asger


-----Oprindelig meddelelse-----
Fra: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] På vegne af John Ruff
Sendt: 2. oktober 2007 16:40
Til: accessd at databaseadvisors.com
Emne: [AccessD] Determine if Object is a Table or View

I'm not sure if the original message got thru, so I'm posting it one
more time.

 

I'm using ADOX in an Access2003 mdb to iterate through the tables in
SQL Server 2000. I only need to gather data on the tables and not any
of the views. Here is the snippit of code I use to capture the table
object.

 

Dim cat As ADOX.Catalog

Dim rst As ADODB.Recordset

Dim tbl As ADOX.Table

    

Set cat = New Catalog

    

cat.ActiveConnection = "Provider=SQLNCLI.1;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=SOLIQ;Data
Source=congo"

Set rst = New ADODB.Recordset

 

For Each tbl In cat.Tables

                ' I would like to determine if the object is a table
or a view here.

 

 

Question: How can I determine if the tbl is a table or view?

 

papparuff

 

John V. Ruff 

Applications Support Analyst

SolutionsIQ

www.SolutionsIQ.com <http://www.solutionsiq.com/> 

10785 Willows Road NE

Redmond, WA 98052

425.250.3484

 

 






More information about the AccessD mailing list