Article View: borland.public.cppbuilder.database.ado
Article #2807Re: Error in code
From: Stephane Baillargeon
Date: Fri, 21 Mar 2003 14:49
Date: Fri, 21 Mar 2003 14:49
33 lines
1924 bytes
1924 bytes
Well one cheap way of doing this would be to test the contents of the query
e.g. :
if(ADOQuery->SQL->Text != "")
{
processing
}
else
{
do nothing
}
"Ernesto Rodriguez" <ernesto@solmeliacuba.net> wrote in message
news:3e724f67@newsgroups.borland.com...
> I'm using this code to open an ADOQuery repeatedly, passing a StrQuery.
But,
> when the dataset is empty and I try to open again the ADOQuery using the
> code bellow, I get this error, exactly in the 'ADOQuery->Close()' code :
>
> exception class.... 'Either BOF or EOF is true, or the current record has
> been deleted. Requested operation requieres a current record'
>
> ADOQuery->Close();
> ADOQuery->SQL->Clear();
> ADOQuery->SQL->Add(StrQuery);
> ADOQuery->Prepared = true;
> ADOQuery->Open();
>
> What's wrong? What can I do to solve this problem?
>
>
>
>
Technical Details
Message-ID:
<3e7b2668$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3e724f67@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,47e863e2d0fd4ee2 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-03-21 07:09:43 PST From: "Stephane Baillargeon" <sbaillargeon@microids.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3e724f67@newsgroups.borland.com> Subject: Re: Error in code Date: Fri, 21 Mar 2003 09:49:04 -0500 Lines: 35 Organization: Microids Canada Inc. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 216.208.130.66 Message-ID: <3e7b2668$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1048258152 216.208.130.66 (21 Mar 2003 06:49:12 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail