Re: query returns no record
"rizky" <[email protected]> Fri, 8 Aug 2003 08:39:33 +0700
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Message-ID | <00b201c35d4d$ebf71790$760aa8c0@agung> |
Hi... I have come to this problem once and i get out this problem by changing the query.open with query.execsql , hope it will answer yours,... ----- Original Message ----- From: "Brigitte Spatz" <[email protected]> To: <[email protected]> Sent: Thursday, August 07, 2003 6: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; // CHANGE IT TO EXECSQL > 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/