UniQuery dataset fieldvalues

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
DavidB
Posts: 3
Joined: Wed 11 Nov 2009 14:03

UniQuery dataset fieldvalues

Post by DavidB » Wed 11 Nov 2009 14:17

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.

tobias_cd
Posts: 56
Joined: Thu 18 Dec 2008 22:10

Post by tobias_cd » Wed 11 Nov 2009 17:20

s := UniQuery.FieldByName['Name'].AsString;
or
s := UniQuery.Fields[0].AsString;
etc.

DavidB
Posts: 3
Joined: Wed 11 Nov 2009 14:03

Post by DavidB » Wed 11 Nov 2009 18:38

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?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 12 Nov 2009 08:23

See the description of the TCustomConnection, TDataSet, and TField classes in the standard Delphi help.

DavidB
Posts: 3
Joined: Wed 11 Nov 2009 14:03

Post by DavidB » Thu 12 Nov 2009 13:59

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 13 Nov 2009 11:01

The FieldValues property is available in TUniQuery.

Post Reply