Page 1 of 1

UniQuery dataset fieldvalues

Posted: Wed 11 Nov 2009 14:17
by DavidB
I'm porting an ADOquery routine to UniQuery but am having difficulty with capturing field values from the dataset that is returned. Briefly, what I'm doing is running the query and setting a string variable = a field value:

UniQuery.SQL.Add('select * from customers');
UniQuery.Open;
UniQuery.First;
s := UniQuery.FieldValues['Name'];

The FieldValue property of the dataset is not recognized. Is there a workaround I can use? I can display the result in a DBGrid, but all I need is the value of the field.

Posted: Wed 11 Nov 2009 17:20
by tobias_cd
s := UniQuery.FieldByName['Name'].AsString;
or
s := UniQuery.Fields[0].AsString;
etc.

Posted: Wed 11 Nov 2009 18:38
by DavidB
Works like a charm.

There are a number of component members that aren't listed in the member list. Where can we find a complete list of available methods, properties, and events for each component including those that are inherited from components higher up in the hierarchy?

Posted: Thu 12 Nov 2009 08:23
by Plash
See the description of the TCustomConnection, TDataSet, and TField classes in the standard Delphi help.

Posted: Thu 12 Nov 2009 13:59
by DavidB
Well, that brings me back to my original post. I had originally started with FieldValues as a property of TDataSet, but it is not available to me in the descendant TUniQuery. It appears that all of the members of TDataSet aren't inherited.

Posted: Fri 13 Nov 2009 11:01
by Plash
The FieldValues property is available in TUniQuery.