Page 1 of 1

Database structure

Posted: Tue 12 Jan 2010 18:19
by Cogito
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!

Posted: Wed 13 Jan 2010 08:30
by Plash
You can use TUniMetaData to get all database tables and fields. But complete information about relations is not currently supported by this component.

Posted: Wed 13 Jan 2010 08:50
by Cogito
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?

Posted: Thu 14 Jan 2010 08:30
by Plash
You cannot get information about relations in database-independent way.

Posted: Thu 14 Jan 2010 09:57
by Cogito
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?

Posted: Fri 15 Jan 2010 12:09
by Plash
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.