Noob : Retrieve FieldNames
Moderators: gto, cipto_kh, EgonHugeist
Noob : Retrieve FieldNames
Hi,
first off a little rant on this project, the project is gread I am happy I don't have to use this whole ODBC connection stuff, that you would normally have to go through to get connected to a database. Well anyway's I was hoping for a little bit more documentation on Zeos, I doesn't seem to find explanations about how to properly use the Lib. I would be more than happy with a simple generated Documentation from the source code's comments, but I guess there is nothing like Javadoc for delphi/pascal.
Anyway my big first ?
How do I get zeoslib to retrieve the Fieldnames, from the current selected table??? Do you have to use ZMetadata and if yes how do I use this to get let say Strings out of it.
Thx in advance, I am not really used to Delphi, first time to try it out, cause a friend of mine had some problems I though I would take a look into it to help him out a bit. Thx a lot though for replies
Cya
first off a little rant on this project, the project is gread I am happy I don't have to use this whole ODBC connection stuff, that you would normally have to go through to get connected to a database. Well anyway's I was hoping for a little bit more documentation on Zeos, I doesn't seem to find explanations about how to properly use the Lib. I would be more than happy with a simple generated Documentation from the source code's comments, but I guess there is nothing like Javadoc for delphi/pascal.
Anyway my big first ?
How do I get zeoslib to retrieve the Fieldnames, from the current selected table??? Do you have to use ZMetadata and if yes how do I use this to get let say Strings out of it.
Thx in advance, I am not really used to Delphi, first time to try it out, cause a friend of mine had some problems I though I would take a look into it to help him out a bit. Thx a lot though for replies
Cya
If you are using a ZTable then:
var
i: Integer;
begin
for i := 0 to Ztable1.FieldCount - 1 do
begin
...... Do stuff here with your fields ........
...... ZTable1.Fields.FieldName ......
end;
end;
Hope this helps.
BTW ZeosLib works in a very similar way to other TDataset descendents. If you look in the Delphi help for TTable or TQuery you should be able to relate most of that to ZeosLib.
Regards,
Ben
var
i: Integer;
begin
for i := 0 to Ztable1.FieldCount - 1 do
begin
...... Do stuff here with your fields ........
...... ZTable1.Fields.FieldName ......
end;
end;
Hope this helps.
BTW ZeosLib works in a very similar way to other TDataset descendents. If you look in the Delphi help for TTable or TQuery you should be able to relate most of that to ZeosLib.
Regards,
Ben
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Hi kobalt,
I fully agree when you say we need some more documentation.
Michael started with some documentation effort the way you proposed, but it's not complete. Please have a look here.
The way I learned how to use Zeoslib the one proposed by Ben : Just look in the Delphi help. There documentation has been written by professionals. There's plenty of examples.
Some additional advise: use a ZQuery instead of a ZTable unless you really need all columns and all rows of a table. (Just for performance.)
Mark
I fully agree when you say we need some more documentation.
Michael started with some documentation effort the way you proposed, but it's not complete. Please have a look here.
The way I learned how to use Zeoslib the one proposed by Ben : Just look in the Delphi help. There documentation has been written by professionals. There's plenty of examples.
Some additional advise: use a ZQuery instead of a ZTable unless you really need all columns and all rows of a table. (Just for performance.)
Mark
Thx a lot guys, I 'll take your advise.
Thanks a lot
*whispers
A few more examples, would be welcome. Just put them as download on the portal, so everybody can have a look into them, doesn't matter if they are crappy .... just to get the idea, cause I think there are more people like me out there.
That's no rant at all....just an advice to get the forums cleaner with noob question like mine.
I've had a look into that ongoing documentation project. It's good to have an overlook on all functions and properties. But as you already said it's not complete.
Keep up the good work!!!
L8tr
That's exactly what I am trying to do atm. Just wanted to List all Entries from a table (Client sortatable) to a TStringGrid. So I guess using ZTable would be the easiest and best way then. I 'll have a look into that.Some additional advise: use a ZQuery instead of a ZTable unless you really need all columns and all rows of a table. (Just for performance.)
Thanks a lot
*whispers
A few more examples, would be welcome. Just put them as download on the portal, so everybody can have a look into them, doesn't matter if they are crappy .... just to get the idea, cause I think there are more people like me out there.
That's no rant at all....just an advice to get the forums cleaner with noob question like mine.
I've had a look into that ongoing documentation project. It's good to have an overlook on all functions and properties. But as you already said it's not complete.
Keep up the good work!!!
L8tr
-
- Senior Boarder
- Posts: 50
- Joined: 31.08.2006, 10:41
- Contact:
-
- Fresh Boarder
- Posts: 20
- Joined: 24.08.2005, 08:50
-
- Senior Boarder
- Posts: 50
- Joined: 31.08.2006, 10:41
- Contact: