Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Update 15 records - 9 get updated ??

0 views
Skip to first unread message

Jan Doggen

unread,
Mar 27, 1998, 3:00:00 AM3/27/98
to

Hi everyone,

This surely confuses me....

In PDox 7, I have a form with a button that when clicked, loops through a
database. When certain conditions are met, the 'Tick' field is filled with an
asterisk and a counter 'NrMatches' is updated. At the end, the code reports
'15 records matched'. If I then run a query on the database with field Tick
'not blank' it only retrives 9 records. The database has a unique primary
index.
What could be going on here?

Here's the code:


method pushButton(var eventInfo Event)
var
PupilCur,KlasCur,KlasHistCur,AdvCur TCursor
AdvNam,ClassNam,HigherClassList,LookUpStr String
AdvNum,ClassNum,CurrCITOUpper,NrMatches SmallInt
endvar

IF NOT PupilCur.Open("LLTEMP.DB") THEN
msgStop("Could not open database","LLTEMP.DB")
ENDIF
IF NOT KlasCur.Open("SCHKLAS.DB") THEN
msgStop("Could not open database","SCHKLAS.DB")
ENDIF
IF NOT KlasHistCur.Open("KLASHIST.DB") THEN
msgStop("Could not open database","KLASHIST.DB")
ENDIF
IF NOT AdvCur.Open("SCHADV.DB") THEN
msgStop("Could not open database","SCHADV.DB")
ENDIF

NrMatches = 0
WHILE NOT PupilCur.Eot()
message(PupilCur.RecNo())
ClassNum = PupilCur.TK1KlasType
AdvNum = PupilCur.SchoolAdvies
IF NOT AdvCur.qLocate(AdvNum) THEN
msgStop("Advice not found",string(AdvNum))
ENDIF
AdvNam = AdvCur.Advies;
IF KlasCur.qLocate(ClassNum) THEN
ClassNam = KlasCur.KlasType
IF NOT AdviceOverlapsClass(AdvNam,ClassNam) THEN
HigherClassList = KlasCur.KlasTypesHoger
IF KlasHistCur.Locate("KlasType",ClassNum) THEN
CurrCITOUpper = KlasHistCur.CITOBovenGrens
WHILE HigherClassList <> ""
ClassNum = SmallInt(ParseSt(HigherClassList,","))
LookUpStr = ","+string(ClassNum)+","
IF KlasHistCur.Locate("KlasType",ClassNum) THEN
IF CurrCITOUpper < KlasHistCur.CITOBovenGrens THEN
CITOScore = PupilCur.CITOStandaardScore
IF CITOScore > KlasHistCur.CITOBovenGrens THEN
NrMatches = NrMatches + 1
PupilCur.Edit()
PupilCur.Tick = "*"
message(string(PupilCur.RecNo())+" !!!!!!!!")
ENDIF
ENDIF
ENDIF
ENDWHILE
ENDIF
ENDIF
ENDIF

PupilCur.Skip()
ENDWHILE
message(string(PupilCur.RecNo()) + " records processed; " +
string(NrMatches) + " match")
PupilCur.Close()
AdvCur.Close()
KlasCur.Close()
KlasHistCur.Close()

endmethod


Moving the PupilCur.Edit() to right behind the WHILE NOT eot() does not help,
neither does inserting a PupilCur.PostRecord() behind the PupilCur.Tick
assignment.

Any ideas?

Thanks,
Jan

-----------------------------------------------------------------------
Jan Doggen Masters Software mas...@xs4all.nl
P.O. Box 697 2300 RA Leiden The Netherlands
-----------------------------------------------------------------------
** Specialists in multimedia software for education and presentation **
-----------------------------------------------------------------------
Usage of this email address for commercial purposes costs US$ 50 per
message. By using this email address you agree to this condition.
-----------------------------------------------------------------------


Sven Pran

unread,
Mar 27, 1998, 3:00:00 AM3/27/98
to Jan Doggen

My prime theory is that you used standard checkmarks and did not include
a unique field (for instance the key) amongst those checked.

With ordinary checkmarks PDOX will not produce duplicates in the answer
file. If this is your problem then you should either check at least
one field that is unique across the table, or use the checkplus function
in your query.

hth

regards Sven

Jan Doggen wrote:
>
> Hi everyone,
>
> This surely confuses me....
>
> In PDox 7, I have a form with a button that when clicked, loops through a
> database. When certain conditions are met, the 'Tick' field is filled with an
> asterisk and a counter 'NrMatches' is updated. At the end, the code reports
> '15 records matched'. If I then run a query on the database with field Tick
> 'not blank' it only retrives 9 records. The database has a unique primary
> index.
> What could be going on here?

. . . . . (snip)

Jan Doggen

unread,
Mar 27, 1998, 3:00:00 AM3/27/98
to

In message <351BC2...@alcatel.no> - Sven Pran <Sven...@alcatel.no>Fri,

27 Mar 1998 16:13:47 +0100 writes:
>
>My prime theory is that you used standard checkmarks and did not include
>a unique field (for instance the key) amongst those checked.
>
>With ordinary checkmarks PDOX will not produce duplicates in the answer
>file. If this is your problem then you should either check at least
>one field that is unique across the table, or use the checkplus function
>in your query.

I should've said that I checked that already ;-)
There *is* a unique key, and I tried both check and checkplus.
Thanks for the try though.

Bye,
Jan


Mike Delaney

unread,
Mar 27, 1998, 3:00:00 AM3/27/98
to

Jan Doggen wrote:
>
> Hi everyone,
>
> This surely confuses me....
>
> In PDox 7, I have a form with a button that when clicked, loops through a
> database. When certain conditions are met, the 'Tick' field is filled with an
> asterisk and a counter 'NrMatches' is updated. At the end, the code reports
> '15 records matched'. If I then run a query on the database with field Tick
> 'not blank' it only retrives 9 records. The database has a unique primary
> index.
> What could be going on here?
>


-----------------> PupilCur.endedit() here??????


I dont see an endedit() in your routine... try that... look for the

------------> inserted into your routine above

--
_________________________________
MDEL...@Sierramicro.com
President
Sierra Micro

0 new messages