Page 1 of 1
Retrieve MySQL Data in Delphi 5
Posted: 25.03.2009, 05:40
by zoombaro
Im developing an application, like a wizard in Delphi 5, now with connection I can retrieve all databases and their tables and fields.
So, now I want to retrieve masterkey, index, foreing keys but I dont know how to do it or what component to use.
please help (sorry my english) !!
Posted: 25.03.2009, 22:05
by mdaems
Try the TZSQLMetadata component, connected to your connection. Then you can set the MetaDataType property to one of these :mdProcedures, mdProcedureColumns, mdTables, mdSchemas, mdCatalogs, mdTableTypes, mdColumns, mdColumnPrivileges, mdTablePrivileges, mdBestRowIdentifier, mdVersionColumns, mdPrimaryKeys, mdImportedKeys, mdExportedKeys, mdCrossReference, mdTypeInfo, mdIndexInfo, mdSequences, mdUserDefinedTypes.
Mark
Posted: 26.03.2009, 04:36
by zoombaro
Thank you !! Ok, I will do it right now !!
By the way, I miss chocolates from your country, snif
Posted: 26.03.2009, 08:05
by zoombaro
Just to document it a little:
I was a little curious what this ZSQLMetadata thing just is, so i did some tests.
I created a new test project and i dropped 4 components on the form.
ZConnection (choose protocol and set db parameters. Connected = true)
ZSQLMetadata (choose connection)
Datasource(set Dataset to Metadata component)
DataGrid(set datasource)
Set everything active. Now you should see some datain the grid. (or an empty dataset. Just play with the MetadataType property of the metadata component. (set active to true after changing the type) mdTables shows table information, but there are plenty of options.
That is an answere that you did some day.
Ok, and a sample that can help, is in the ZEOSDBO-6.6.2-rc.zip file ,
directory : ZEOSDBO-6.6.2-rc\examples\controls
Just install the database and test the delphi project !!
I will stay here ...