Thanks! I used TablesList := TStringList.Create; dm.ADOConnectionMain.GetTableNames(TablesList, false);
and it worked. thanks for your help ________________________________ ________________________________ From: Robert Jenkins <[email protected]> To: [email protected] Sent: Tue, December 22, 2009 5:23:04 AM Subject: Re: [delphi-en] retrieve all table names from access dbase using ADO I think this is what you are looking for... procedure TADOConnection.GetTableNames(List: TStrings;SystemTables: Boolean); Populates a string list with the names of tables in the database. Call GetTableNames to retrieve a list of tables in the associated database. List is the already-existing string list object into which the tables names are put. Set SystemTables to indicate whether the list of table names should include the database's system tables. ADOConnection1.GetTableNames(ListBox1.Items, False); There is also a procedure called GetFieldNames. Robert On Mon, Dec 21, 2009 at 4:52 PM, Andries Bos <[email protected]> wrote: > > > I would like o connect to an access database at runtime. I use an > TADOConnection and a TAdoTable to populate a datagrid with the actual data. > > I can connect the the database at runtime by using a dynamic > connectionstring usign somthing like. "'Provider=Microsoft.Jet.OLEDB.4.0;'+ > ".... > > There are plenty of good examples to learn how to do this. > > however I would populate a combobox with the table name to let the user > pick one of them. > The chosen table name would be used to set the Tadotable.tablename > property. > > How could I retrieve all table names within a chosen Access database? ( > > Regards > > Andries > > ________________________________ > > Slide scanning / dia's scannen > vanaf / from > E0,08c > www.scancare.nl > > ________________________________ > > [Non-text portions of this message have been removed] > > > [Non-text portions of this message have been removed] ------------------------------------ ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [email protected]! Groups Links [Non-text portions of this message have been removed]

