Re: query returns no record

"Fabiano Paolini" <[email protected]> Thu, 7 Aug 2003 14:00:38 +0200
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <006601c35cdb$84dff990$2716a8c0@PAOLINI>
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/