🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: invalid field size TADOQuery

#372
From: Bob Swart
Date: Thu, 21 Sep 2006 12:54
36 lines
2354 bytes
Hi siraj,

> sprintf(cmd,"SELECT
> Avg(IIf(((Conc)*%lf)<((%lf)*%lf),(%lf)*%lf,((Conc)*%lf))) as AvgConc,Channel
> FROM archives WHERE ((ts>= %lf AND ts<= %lf) AND Transit<>1 AND
> DisplayFlag=true AND conc is NOT NULL ) GROUP BY
> channe1",dMultiplicationFactor,dMinimumValue,dMultiplicationFactor,dMinimumV
> alue,dMultiplicationFactor,dMultiplicationFactor,ss,ee);

I guess it would help to show the result of this "cmd" after the sprintf 
command (I don't have the mental capacity right now to produce it in my 
head right now).

>    ReportConcADOQuery->Close();
>    ReportConcADOQuery->SQL->Clear();
>    ReportConcADOQuery->SQL->Add(cmd);
>    ReportConcADOQuery->Open();
> 
> I am getting the error "EDatabaseError"  "Invalid field size".

You could set breakpoints to find out there the error is happening. I 
have a feeling it's simple happening at the Open() command, because 
something is wrong inside the "cmd" itself...

Please just post an example of the cmd you're using here. Perhaps one of 
the field values is empty (or NULL) in some cases?

> Siraj

Groetjes,
           Bob Swart

-- 
Bob Swart Training & Consultancy (eBob42.com)  Forever Loyal to Delphi
Blog: http://www.drbob42.com/blog - RSS: http://drbob42.com/weblog.xml
New Delphi 2006 Courseware e-books at http://www.eBob42.com/courseware
Technical Details
Message-ID: <45128B9C.6030609@chello.nl>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4512829e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,383859d72830abc4
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
Message-ID: <45128B9C.6030609@chello.nl>
Date: Thu, 21 Sep 2006 14:54:52 +0200
From: Bob Swart <b.swart@chello.nl>
Organization: Bob Swart Training & Consultancy (eBob42)
User-Agent: Thunderbird 1.5.0.7 (Windows/20060909)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: invalid field size TADOQuery
References: <4512829e$1@newsgroups.borland.com>
In-Reply-To: <4512829e$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 212.187.74.50
X-Trace: newsgroups.borland.com 1158843295 212.187.74.50 (21 Sep 2006 05:54:55 -0700)
Lines: 36
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail