Board index » delphi » Getting a list of Tables in a Database

Getting a list of Tables in a Database

Having just connected to a database (Access) at run-time (database file
name not known at design time), can I somehow get a list of all the tables
in the database? The DataSets and DataSetCount properties only refer to
open tables.

Neil McCrossin
Brisbane, Australia

 

Re:Getting a list of Tables in a Database


Re:Getting a list of Tables in a Database


TSession.GetTableNames

Re:Getting a list of Tables in a Database


Re:Getting a list of Tables in a Database


Quote
In article <01bd3119$b424dca0$1a4901cb@rory> "Neil McCrossin" <n...@gil.com.au> writes:
>From: "Neil McCrossin" <n...@gil.com.au>
>Subject: Getting a list of Tables in a Database
>Date: 4 Feb 1998 03:18:59 GMT
>Having just connected to a database (Access) at run-time (database file
>name not known at design time), can I somehow get a list of all the tables
>in the database? The DataSets and DataSetCount properties only refer to
>open tables.
>Neil McCrossin
>Brisbane, Australia

I don't know about Access, but on a Paradox database the Session component has
a method which gives me a list of tables.

HTH,
         John.

Re:Getting a list of Tables in a Database


Neil McCrossin <n...@gil.com.au> wrote in article
<01bd3119$b424dca0$1a4901cb@rory>...

Quote
> Having just connected to a database (Access) at run-time (database file
> name not known at design time), can I somehow get a list of all the
tables
> in the database? The DataSets and DataSetCount properties only refer to
> open tables.

> Neil McCrossin
> Brisbane, Australia

Try this:

Session.GetTableNames('My_Database','*.db',False, False,
TableComboBox.Items);

I used this in a program I wrote.  It works fine.  The TableComboBox is a
TComboBox component on a form.  I store the tablenames from the My_Database
alias in the TComboBox's Items.  Use this line after the session is active.

Njoy,
bp

Other Threads