Board index » delphi » Capitalizing Lookup Data

Capitalizing Lookup Data

Hi,

What would be the best approach to capitalize selected fields obtained from
a TQuery for lookup display purposes ?  We're using a TClientDataSet in
conjunction with dblookup components ... we've failed so far, as we can't
get around the fact that the DataSet isn't in edit mode ... so how do you
intercept records as they are fetched and customize them ?

Andrew

 

Re:Capitalizing Lookup Data


Depending upon circumstances, you could always cheat: copy/transform the
data into a mirror ClientDataset.  This might not always be appropriate
though.
Pete K
Quote
"Andrew Jameson" <cont...@softspotsoftware.com> wrote in message

news:3e4a1915@newsgroups.borland.com...
Quote
> Hi,

> What would be the best approach to capitalize selected fields obtained
from
> a TQuery for lookup display purposes ?  We're using a TClientDataSet in
> conjunction with dblookup components ... we've failed so far, as we can't
> get around the fact that the DataSet isn't in edit mode ... so how do you
> intercept records as they are fetched and customize them ?

> Andrew

Re:Capitalizing Lookup Data


Quote
"Andrew Jameson" <cont...@softspotsoftware.com> wrote in message

news:3e4a1915@newsgroups.borland.com...

Quote
> Hi,

> What would be the best approach to capitalize selected fields obtained
from
> a TQuery for lookup display purposes ?  We're using a TClientDataSet in
> conjunction with dblookup components ... we've failed so far, as we can't
> get around the fact that the DataSet isn't in edit mode ... so how do you
> intercept records as they are fetched and customize them ?

Depends on the database you using. If you're using IB or another that let's
you define UDF's, then I would write a small UDF to do the capitalization
through a selectable stored procedure. If not, I would probably opt for
populating the lookup list myself by iterating through records and adding a
capitalized version of the field information using a simple function.

--
Woody (TMW)

"Never trust a computer you can't throw out a window."
-Steve Wozniak

Re:Capitalizing Lookup Data


Thanks Woody,

UDFs ? ... Yes I must look into these as I am using IB ! ... Capitalizing
Spanish words is more problematic so, for the time being, I'm doing it
locally ... I'd forgotten that I was using a ClientDataSet and it's easy to
do.

Andrew

Other Threads