Re: How to get table names from ms access(mdb file) by using odbc library.



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


.



Relevant Pages

  • Re: VB.NET Deployment - Checking for user-modified files
    ... I think your MDB file would be an unversioned file and so: ... Create date for the file on the computer, do not install the file because ... > the installation problem with preferences by using a text file for ... properties and set to not overwrite. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Method ~ of object ~ failed error while opening ADODB connection in vb6
    ... the MDAC or Jet installation is "corrupt" (anything from incorrect ... if using Vista - you can't install the MDAC as it already comes ... ActiveX Data Objects 2.7 library", ... Perhaps the mdb file is corrupt. ...
    (microsoft.public.vb.database)
  • Re: MDE
    ... Well, if you need word, or excel...you install word or excel. ... the code and design parts of the application (the application part is the ... or mde file..you need some ... person a 2002 version of the mdb file. ...
    (microsoft.public.access.formscoding)
  • Re: Error created linked tables from one .mdb to another .mdb
    ... > tables to SQL Server tables in my .mdb file. ... > the strConnect parameter to connect to the other .mdb file that it would ... > link properly but it fails with this messagebox message popping up: ... Sounds like you may need to install the Jet OLE DB provider on the target ...
    (microsoft.public.vb.general.discussion)
  • Re: P4C800-DELUXE XP Install Problems --- Hanging
    ... Windows Install Guide by Mr Steveo from ABX Zone Website. ... Additionally, if you have a Springdale or Canterwood chipset motherboard, ... Install chipset INFs before any video or sound drivers. ...
    (alt.comp.periphs.mainboard.asus)