🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1387

Re: Searching on double precision fields

#1387
From: Mark Guerrieri
Date: Mon, 02 Aug 2004 15:48
42 lines
2341 bytes
In BCB6, the AnsiString(double) constructor internally calls FloatToStr,
which uses the value of the global variable DecimalSeparator to represent
the decimal point.  Try something like this:

double Value;
char OldDecimalSeparator = DecimalSeparator;
DecimalSeparator = '.';
DataSet1->Filter = "FloatField<=" + AnsiString( Value );
DecimalSeparator = OldDecimalSeparator;
DataSet1->Filtered=true;

Mark

"Michele Santucci" <michele.santucci.nospam@nospam.celinavio.it> wrote in
message news:410e51f0@newsgroups.borland.com...
> I have a field of a record (MS Access MDB file) defined as double
precision
> I need to query it at runtime using the Filter Adodataset property
> If I do something of this kind
>
> double Value;
> DataSet1->Filter = "FloatField<=" + AnsiString( double );
> DataSet1->Filtered=true;
>
> I always got no result since the decimal separator in my local (italian)
is
> different from the default one of AnsiString.
> And then if Value=10.3 the Filter property is set to "FloatField<=10,3"
> If I try to execute the query manually using the original 10.3 notation
the
> query give the expected results.
>
> -- 
> ================================
> Michele Santucci
> Software Development Manager
> Celin Avio S.r.l.
> Via Fontevivo, 21/M 19100 La Spezia
> tel. +39-0187564080
> ================================
>
>
Technical Details
Message-ID: <410e625a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <410e51f0@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,5515ed52d6570b06
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Mark Guerrieri" <mguerrieri@cmsgrp.com>
From: "Mark Guerrieri" <mguerrieri@cmsgrp.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <410e51f0@newsgroups.borland.com>
Subject: Re: Searching on double precision fields
Date: Mon, 2 Aug 2004 11:48:42 -0400
Lines: 44
Organization: Creative Marketing Strategies
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 66.200.143.50
Message-ID: <410e625a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1091461722 66.200.143.50 (2 Aug 2004 08:48:42 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail