Page 1 of 1

Firebird Metadata

Posted: 20.06.2008, 20:53
by martinrame
I'm trying to extract the list of tables from an Firebird 2.0.3 database using TZSqlMetadata and this code:

AConnection is a reference to the connected database (it's connected, don't worry!).

Code: Select all

AMetadata := TZSQLMetadata.Create(nil);
  AMetadata.Connection := AConnection;
  AMetadata.MetadataType := mdTables;
  AMetadata.Open;
  while not AMetadata.Eof do
  begin
      lMyList.Add(AMetadata.TableName);
    AMetadata.Next;
  end;
  AMetadata.Close;
AMetadata.Free
The while loop iterates aproximately the number of database objects, I think it's correct, the problem is AMetadata.TableName is equal to '' (empty) for all tables, also when I look for AMetadata.ProcedureName is empty and all AMetadata properties.

¿It's a bug? ¿can you help me?

Leonardo.

Posted: 20.06.2008, 21:02
by martinrame
Sorry, my fault.

I was using AMetadata.TableName instead of AMetadata.FieldByName('TABLE_NAME').AsString;

Leonardo