testfl.pp 586 B

1234567891011121314151617181920212223242526272829
  1. program testfl;
  2. {$mode objfpc}
  3. uses fpodbc,Classes;
  4. var
  5. Conn : TODBCConnection;
  6. FieldNames : TStringList;
  7. I : Integer;
  8. begin
  9. Conn:=TODBCConnection.Create(Nil);
  10. Try
  11. Conn.DSN:='FPC';
  12. Conn.Active:=True;
  13. FieldNames:=TStringList.Create;
  14. FieldNames.Sorted:=True;
  15. Try
  16. Conn.GetFieldNames('FPDev',FieldNames);
  17. Writeln('Found ',FieldNames.Count,' Fields in table FPDev : ');
  18. For I:=0 to FieldNames.Count-1 do
  19. Writeln(FieldNames[i]);
  20. finally
  21. FieldNames.Free;
  22. end;
  23. Conn.Active:=False;
  24. Finally
  25. Conn.free;
  26. end;
  27. end.