query returns no record

"Brigitte Spatz" <[email protected]> Thu, 7 Aug 2003 13:11:18 +0200
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <000001c35cd4$a5b21740$8becfea9@LAPTOP>
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]


------------------------ 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/