🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
3 messages
3 total messages Started by Mike Collins Wed, 19 Mar 2008 13:13
Formating an AsString value from ADO query
#15
Author: Mike Collins
Date: Wed, 19 Mar 2008 13:13
23 lines
1818 bytes
Hi all, got a really simple question but can seem to find the right 
function.

I have an MS Access database with a table that has two fields which are set 
a Decimal values.  I run an ADO query to get all the values from the table 
and I want to assign the returned information into a comma-delimited string 
list.

My problem is that when I use the AsString i.e. 
quStaffInfo->FieldByName("rateOfPay")->AsString the value does not get 
converted correctly.  For example, if I have a value of 43.00 in the 
database, when I use AsString, the value gets returned as 43. without the 
precision.  If I have a value of 0.10 I get .1 returned.

It may be that Access is returning these values in this format, but 
displaying them differently when I examine the contents in Access.

Can anyone point me in the right direction to convert this correctly and 
maintain the format that I need?

Many thanks in advance,

Mike C 
Re: Formating an AsString value from ADO query
#16
Author: Mike Collins
Date: Wed, 19 Mar 2008 13:25
4 lines
1053 bytes
Please ignore, I've just found FloatToStrF which does the job nicely - sorry 
for the wasted post...

Mike C 
Re: Formating an AsString value from ADO query
#29
Author: brendan.hoffmann
Date: Tue, 22 Apr 2008 21:11
8 lines
1576 bytes
On Mar 19, 8:25 am, "Mike Collins" <its@TheBottomOfThePost> wrote:
> Please ignore, I've just found FloatToStrF which does the job nicely - sorry
> for the wasted post...
>
> Mike C

By no means is this post wasted.  I learned something new today
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads