Database structure

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Cogito
Posts: 24
Joined: Sat 05 Jul 2008 07:15

Database structure

Post by Cogito » Tue 12 Jan 2010 18:19

Hello,

Is it possible, to get the complete structure of a database by a given database connection (all contained tables, fields of the tables, relations and the fields where the relations are based on)? Is that the same logic for every database format (I guess that's the idea of universal components; to capsulate the complexity of every database)? Is there an example application to demonstrate this?

Thanks in advance!

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 13 Jan 2010 08:30

You can use TUniMetaData to get all database tables and fields. But complete information about relations is not currently supported by this component.

Cogito
Posts: 24
Joined: Sat 05 Jul 2008 07:15

Post by Cogito » Wed 13 Jan 2010 08:50

Plash wrote:You can use TUniMetaData to get all database tables and fields. But complete information about relations is not currently supported by this component.
But I've to connect to an unknown (and possible changed) database at runtime, therefore I need information about the relations. Is there another solution?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 14 Jan 2010 08:30

You cannot get information about relations in database-independent way.

Cogito
Posts: 24
Joined: Sat 05 Jul 2008 07:15

Post by Cogito » Thu 14 Jan 2010 09:57

Plash wrote:You cannot get information about relations in database-independent way.
And what about the tables which are included in a database, is this structure always the same for all different database formats if I use your TMetaData component? By the way, I don't know how to deal with this component, is there a sample for the usage?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 15 Jan 2010 12:09

You can use TUniMetaData like TUniQuery. Call the Open method and read data from the field. Link TUniMetaData to TDBGrid to see its fields and data.
Set the MetaDataKind property to 'Tables' to get information about tables.

Post Reply