Article View: borland.public.cppbuilder.database.ado
Article #15Formating an AsString value from ADO query
From: Mike Collins
Date: Wed, 19 Mar 2008 13:13
Date: Wed, 19 Mar 2008 13:13
23 lines
1818 bytes
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
Technical Details
Message-ID:
<47e10f16$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,dbf496bb6e1a421f,start X-Google-Attributes: gid10698b,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Mike Collins" <its@TheBottomOfThePost> Newsgroups: borland.public.cppbuilder.database.ado Subject: Formating an AsString value from ADO query Date: Wed, 19 Mar 2008 13:13:27 -0000 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.3959 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133 NNTP-Posting-Host: 89.241.134.222 Message-ID: <47e10f16$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1205931798 89.241.134.222 (19 Mar 2008 06:03:18 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail