RE: query returns no record

Mike Smit <[email protected]> Thu, 7 Aug 2003 14:45:38 +0200
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
RecordCount has been known to not be so accurate. If you want to test for an
empty resultset rather use IsEmpty.

-----Original Message-----
From: Brigitte Spatz [mailto:[email protected]] 
Sent: 07 August 2003 05:45 AM
To: [email protected]
Subject: RE: [Delphi] query returns no record

I had already tried removing RecordCount and put a watch on
Fields[0].Value, which then returned Null, so it's not a problem with
RecordCount.

> -----Original Message-----
> From: Fabiano Paolini [mailto:[email protected]] 
> Sent: 07 August 2003 14:01
> To: [email protected]
> Subject: Re: [Delphi] query returns no record
> 
> 
> May be that the problem is using RecordCount.
> Try using BOF and EOF (both true means empty query) or, if 
> present, Empty property.
> 
> Fabiano
> 
> ----- Original Message -----
> From: "Brigitte Spatz" <[email protected]>
> To: <[email protected]>
> Sent: Thursday, August 07, 2003 1:11 PM
> Subject: [Delphi] query returns no record
> 
> 
> > SELECT P.Register, P.[First Name], AE.[Kind Of Event], AP.ID FROM 
> > Assured_Person AS AP, Person AS P, Assurance_Event AS AE 
> WHERE AP.ID = 
> > AE.ID AND AP.[Person ID] = P.ID
> > AND P.Register = :Register
> > AND AE.[Kind Of Event] = :Event
> >
> > returns the correct records when run from within Access. 
> When run from 
> > Delphi, it only returns the correct record on the first run but on 
> > consecutive calls to the following function returns a 
> recordcount of 0 
> > although both parameters have the correct values that do return a 
> > record in Access:
> >
> > procedure MakeTocLetters(NextRegister, Event: integer);
> > begin
> >   with frmDMGenerator.qryGeneratorAssuranceEventDetails do
> >   begin
> >     Parameters[0].Value := Event;
> >     Parameters[1].Value := NextRegister;
> >     Open;
> >     if RecordCount > 0 then
> >     begin
> >       First;
> >       while not EOF do
> >       begin
> >         strScript := strScript + 'insDoc(' +
> > AssuranceEventConcatenated(Event) +
> >           ', gLnk(0,' + QuotedStr(_('Letter for ') + '11-' +
> > Fields[3].AsString)
> >           + ', ' + QuotedStr('11-' + IntToStr(NextRegister) + '-' +
> >           IntToStr(Event) + '-' + Fields[3].AsString + 
> '.htm') + '))' 
> > + #13#10;
> >         Next;
> >       end;
> >     end;
> >     Close;
> >   end;
> > end;
> >
> > I'm sure it must be something obvious but I can't see it. Any help 
> > appreciated.
> >
> > TIA.
> >
> > Brigitte
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > CodeCoffer - new Delphi code protection Tool! 
> > http://www.delphicollection.com/public/CodeCoffer.htm
> > ---------------------------------------------------------------
> > Unsubscribe:[email protected]
> > List owner:[email protected]
> > ---------------------------------------------------------------
> >
> > Your use of Yahoo! Groups is subject to 
> > http://docs.yahoo.com/info/terms/
> >
> >
> 
> 
> ------------------------ Yahoo! Groups Sponsor 
> ---------------------~--> Buy Ink Cartridges or Refill Kits 
> for Your HP, Epson, Canon or Lexmark Printer at Myinks.com. 
> Free s/h on orders $50 or more to the US & Canada. 
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/i7folB/TM
---------------------------------------------------------------------~->

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/ 




CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



[Non-text portions of this message have been removed]


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/i7folB/TM
---------------------------------------------------------------------~->

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/