oAcc = CREATEOBJECT("Access.Application")
lcmdb=GETFILE('mdb')
oAcc.OpenCurrentDatabase(lcmdb)
LOCAL lnTables
lnTables = oAcc.CurrentData.AllTables.Count
FOR i = 1 TO lntables
 lctable=oacc.CurrentData.AllTables(i).name
 IF OCCURS('MSys',lctable)=0
  ?lctable
 endif
endfor

John

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Paul Newton
Sent: Wednesday, January 31, 2007 5:13 PM
To: profox@leafe.com
Subject: Access automation 

Hi all

I am trying to get a list of tables in an MS Access MDB and what I have 
so far is

oAcc = CREATEOBJECT("Access.Application"
oAcc.OpenCurrentDatabase("MyDatabase.MDB")
LOCAL lnTables
lnTables = oAcc.CurrentData.AllTables.Count

This returns a value of 9 for lnTables but the MDB only contains 2 
(user) tables - the rest are apparently system tables whose names all 
begin with MSys.

How can I get a count/list of the tables excluding the system tables 
(without iterating all of them to exclude the system tables) ?

Thanks

PS What I am eventually trying to do is give the user a choice of tables 
and then use the Access Export functionality to create a DBF(s).  I have 
done this before using ADODB and the Microsoft.Jet.OLEDB provider but 
would like to try this different approach.





[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to