Re: How to get table names from ms access(mdb file) by using odbc library.
- From: "Albert D. Kallal" <PleaseNOOOsPAMmkallal@xxxxxxx>
- Date: Sat, 09 Aug 2008 01:04:55 GMT
If you using odbc to a mdb file, then you MUST have jet installed, and
THEREFORE you MUST also have dao installed on your machine (in fact, out of
the box, windows xp, server 2003, vista etc DOES HAVE the jet database
engine installed by default (thus you don't need to install anything on a
windows computer to read mdb files.
here is a windows (vbs) script that displays all tables...you can use late
binding in your project, and you should little trouble getting a list of
tables using the following idea.
Set dbeng = CreateObject("DAO.DBEngine.36")
strMdbFile = "C:\Documents and Settings\Lawrence\My
Documents\Access\ScriptExample\MultiSelect.mdb"
Set db = dbeng.OpenDatabase(strMdbFile)
for each table in db.tabledefs
msgbox table.name
next
The above is not a vba script. Paste the above into a text document, and
then re-name the extension as .vbs. If you double click on this file...you
see it list the tables in the given mdb file..
So there is a table collection available after you open the mdb file as per
above...
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@xxxxxxx
.
- Follow-Ups:
- References:
- Prev by Date: Re: How often to automatically compact & repair a replicated database
- Next by Date: Re: Speed Improvements With SQL Server?
- Previous by thread: How to get table names from ms access(mdb file) by using odbc library.
- Next by thread: Re: How to get table names from ms access(mdb file) by using odbc library.
- Index(es):
Relevant Pages
|