On 06-01-12 01:20, Maximiliano Duarte wrote:
When you open the query you object is deleted.
If yuo need only a field name is

Query1.sql.text:= "select * from mytable";
Query1.open;
Name:=Query1.Fields[0].fieldname;


Thanks for your response, but it does not work.

The table I use has more than five fields. I manually created one field (double clicking the sqlQuery and adding one field).
When I run the program, I display Query1.FieldCount : 1.
When I try to display Query1.Fields[1].fieldname ([1], i.e. the second fieldname) I get an "list index out of bounds" error. Displaying Query1.Fields[0].fieldname gives the fieldname of the field I manually created.

So is there a way to what Lazarus can do (adding fields) by using the properties and/or methods of a TSQLQuery, or another component ?

Thanks for any help,

Koenraad Lelong.

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to