πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: invalid field size TADOQuery

#373
From: siraj
Date: Thu, 21 Sep 2006 13:57
59 lines
3022 bytes
It is happening at the line where the query is opened.
ReportConcADOQuery->Open();

The "invalid field size" error  is occuring randomly on the same command.

Some times it does not give an error at all

The sql command is

SELECT
Avg(IIf(((Conc)*1.000000)<((0.020000)*1.000000),(0.020000)*1.000000,((Conc)*
1.000000))) as AvgConc,Channel FROM archives WHERE ((ts>= 38952.000000 AND
ts<= 38962.000000) AND Transit<>1 AND DisplayFlag=true AND conc is NOT NULL)
GROUP BY Channel;


Regards,
Siraj

"Bob Swart" <b.swart@chello.nl> a οΏ½crit dans le message de
news:45128B9C.6030609@chello.nl...
> 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: <45129a65@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4512829e$1@newsgroups.borland.com> <45128B9C.6030609@chello.nl>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,383859d72830abc4
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
Reply-To: "siraj" <siraj.sm@omnisens.ch>
From: "siraj" <siraj.sm@omnisens.ch>
Newsgroups: borland.public.cppbuilder.database.ado
References: <4512829e$1@newsgroups.borland.com> <45128B9C.6030609@chello.nl>
Subject: Re: invalid field size TADOQuery
Date: Thu, 21 Sep 2006 15:57:51 +0200
Lines: 61
Organization: omnisens
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
X-Antivirus: avast! (VPS 0638-0, 19/09/2006), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 212.109.69.36
Message-ID: <45129a65@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1158847077 212.109.69.36 (21 Sep 2006 06:57:57 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail