Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread FieldByName Mk II
Sun, Jul 25 2010 6:20 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate


I've decided that I'm going to get persistent fields for any table or query where the field list is constant. Being lazy I've written a small utility.
Add the unit to a project and run it after the table/query is opened, open notepad and when told that the data is on the clipboard paste it into there, close your app and paste into the .pas class definition and into the .dfm in the table/query definition - voila persistent fields.

Its in the binaries

Roy Lambert
Sun, Jul 25 2010 9:44 PMPermanent Link

David Cornelius

Cornelius Concepts

Avatar

Wow, that's cool.  But it seems like a lot of work to replace:
double-click on the component, right-click in the field list and select
Add all fields.

--
David Cornelius
Cornelius Concepts

On 7/25/2010 3:20 AM, Roy Lambert wrote:
> I've decided that I'm going to get persistent fields for any table or query where the field list is constant. Being lazy I've written a small utility.
> Add the unit to a project and run it after the table/query is opened, open notepad and when told that the data is on the clipboard paste it into there, close your app and paste into the .pas class definition and into the .dfm in the table/query definition - voila persistent fields.
>
> Its in the binaries
>
> Roy Lambert
Mon, Jul 26 2010 3:45 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

David


>Wow, that's cool. But it seems like a lot of work to replace:
>double-click on the component, right-click in the field list and select
>Add all fields.

Not when (as an example) the table is an in-memory table populated by a parameterised script Smiley

Or the query is
like the following simple example

SELECT
_LogType,
COUNT(*) AS _Count,
CAST(100* COUNT(*) / (SELECT COUNT(*) FROM $log) AS DECIMAL(5,2)) AS _Percentage
FROM $log  
GROUP BY _LogType
UNION ALL
SELECT
'TOTALS',
COUNT(*) AS _Count,
CAST(100* COUNT(*) / (SELECT COUNT(*) FROM $log) AS DECIMAL(5,2)) AS _Percentage
FROM $log  
ORDER BY _Count  DESC

The $ stuff is altered at run time

Roy Lambert
Image