Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find Attached tables in an mdb file 2

Status
Not open for further replies.

rewdee

Programmer
Aug 17, 2001
295
US
Does anyone know how to find attached tables in an mdb file. I thought I could query the msysobject table of an mdb file but cannot get access to the table using ADO -- No read permission. Is there another way to find attached tables and their data sources?

Thanks
Rewdee
 
Can you see the structure in the Database Explorer? S. van Els
SAvanEls@cq-link.sr
 
Thanks for the response.

Do you mean the SQL Explorer? How do you use the SQL Explorer with ADO? I can connect my TADOQuery component to a table in the database without difficulty.

Thanks,
Rewdee
 
Yes the SQL explorer, also called database explorer in earlier versions of Delphi.

It is an utility which shows the structure and relations of a Database. It is not used with ADO, but with the BDE.

You have to make an alias to the database, and it shows the data, tables, fields, look-up keys, referential constraints and validity checks on the database. It also have sql querying capabilities, so you can test your queries before you construct them in Delphi. Very handy if you are not the designer of the database. S. van Els
SAvanEls@cq-link.sr
 
I cannot use the BDE in my app so I don't know if the SQL Explorer is of any help.

Thanks,
Rewdee
 
It cannot be used inside an application!!! it is not a component!!! S. van Els
SAvanEls@cq-link.sr
 
What I'm trying to say is even if I could use the SQL explorer which is bde dependent to view the msysObjects table, it is no use to me because I cannot use the BDE in my app. I must use ADO to get at the msysObjects table and hence irrelevants of whether I can see the msysObjects table.

Rewdee
 
Use the GetTableNames method of the ADO Connection object. It will populate a stringlist with tables. The second parameter determines if system tables are includedin the list.

ADOConnection1.GetTableNames(ListBox2.Items, False);

Alternatively, use the GetSchema method. This returns a dataset containing all sorts of interesting info about the database such as indexes, fields etx.
Peter gore
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top