Article View: borland.public.cppbuilder.database.ado
Article #323Re: TADOQuery problem
From: Cenk
Date: Fri, 04 Aug 2006 16:20
Date: Fri, 04 Aug 2006 16:20
40 lines
2142 bytes
2142 bytes
thanks for your warning but there is no NULL in table.
Now there is another error pops up!
TADOQuery *CountQuery;
CountQuery= new TADOQuery (this);
CountQuery->Connection = ADOConnection1;
CountQuery->SQL->Add ("select COUNT(bid) from ["+table+"]");
CountQuery->Open ();
count = CountQuery->FieldByName ("COLUMN1")->AsInteger;
CountQuery->SQL->Clear();
CountQuery->SQL->Add ("select [bid],[fTime] from ["+table+"] order by
[fTime] ASC");
CountQuery->Open ();
for (int i = 0;i<count ;i++)
{
v_bid.push_back(CountQuery->FieldByName ("bid")->AsFloat);
v_time.push_back(CountQuery->FieldByName ("fTime")->AsDateTime);
CountQuery->Next ();
}
start = v_time.at(0);
end = v_time.at(count-1);
CountQuery->Close(); -----> NOW IT GIVES ERROR HERE! ITS EITHER BOF
OR EOF OR THERE IS NO VALID RECORD
CountQuery->SQL->Clear();
CountQuery->SQL->Add ("SET DATEFORMAT dmy");
CountQuery->SQL->Add ("SELECT distinct DATEDIFF(n, '"+start+"',
'"+end+"') AS diff from ["+table+"]");
CountQuery->Open ();
Technical Details
Message-ID:
<44d373f4@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.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-mailReferences:
<44d36e64@newsgroups.borland.com> <44d37209@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,8c96c50763dd0dab X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Cenk" <cenk1536@yahoo.com> From: "Cenk" <cenk1536@yahoo.com> Newsgroups: borland.public.cppbuilder.database.ado References: <44d36e64@newsgroups.borland.com> <44d37209@newsgroups.borland.com> Subject: Re: TADOQuery problem Date: Fri, 4 Aug 2006 19:20:39 +0300 Lines: 44 Organization: Freelance X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 NNTP-Posting-Host: 81.214.143.82 Message-ID: <44d373f4@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1154708468 81.214.143.82 (4 Aug 2006 09:21:08 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.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