Why?? Append not ok 
Author Message
 Why?? Append not ok

Hi all,

I'm trying to find a clue why the following is not working.
I run this code on 2 machines at the same time.
So I should finally end up with 2000 records when both are finished
but I only get 1000 records.

When testing this in clipper 5.2 it's ok. Under VO1.0d or 2.0b it's
NOT

///
    DO WHILE test->(DBAPPEND())=FALSE .or. NetErr()

use test shared new  via "DBFNTX"
   FOR teller:=1 TO 1000

    DO WHILE !test->(DBAPPEND())
        odcstatustext:caption:="appending"
    ENDDO

   test->(DBCOMMIT())
   test->(DBUNLOCK())
   NEXT

infobox{SELF,"records",NTrim(test->(LASTREC()))}:show()
close test

when I would replace the !test->(append()) with neterr() the same
result.
If I check on both with something like
    DO WHILE test->(DBAPPEND())=FALSE .or. NetErr()

Then I will endup with about 2500 records.

It seems like the neterr and append are not always returning false
when the record is not added. I'm using win95osr2 with the vredir.vxd
patch on both machines and NT4 SBS as server with ntnfs.

This code if of course not the final code but a testsample to
demonstrate the problem.

If anyone has a clue on how to fix this please reply or mail me. I
need this fixed and fast (something like yesterday)

TIA

Gerard Daniels



Thu, 07 Sep 2000 03:00:00 GMT  
 Why?? Append not ok

Hi All,

Never mind. I found the problem after all.

When going through all the files I found another patch from Microsoft.
It was an older one. This one did fix the problems.

I had installed Secupd2.exe which installs a vredir.vxd with version
.1114.
This one does not fix the problem
So Now I installed the older vrdr2upd.exe which has a vredir.vxd
version .950.
This one works!! So be carefull. It might be that the new update does
not fix some registry settings or that the newer file has [back] the
problem.

Be warned!!!

Gerard Daniels



Fri, 08 Sep 2000 03:00:00 GMT  
 Why?? Append not ok

If you are using a machine with a CPU faster than 75Mghz I would suggest
linking in __wait_b.obj available from Oasis as R6003fix.zip.

I had similar append lock problems on a 100mghz 5x86 machine until I linked
in this obj. Its an incompatablity between Clipper's timing and the timing
loops of the CPU.

--

Cheers......

Will
Want to know VO?
Visit KnowVO, the VIsual Objects knowledgebase
at http://www.knowvo.com
Have you made a contribution lately?
:Hi all,
:



Sat, 09 Sep 2000 03:00:00 GMT  
 Why?? Append not ok

On Sun, 22 Mar 1998 23:58:35 +0100, "Gerard Daniels"

Quote:

>I'm trying to find a clue why the following is not working.
>I run this code on 2 machines at the same time.
>So I should finally end up with 2000 records when both are finished
>but I only get 1000 records.

>When testing this in clipper 5.2 it's ok. Under VO1.0d or 2.0b it's
>NOT

>///
>    DO WHILE test->(DBAPPEND())=FALSE .or. NetErr()

>use test shared new  via "DBFNTX"
>   FOR teller:=1 TO 1000

>    DO WHILE !test->(DBAPPEND())
>        odcstatustext:caption:="appending"
>    ENDDO

>   test->(DBCOMMIT())
>   test->(DBUNLOCK())
>   NEXT

>infobox{SELF,"records",NTrim(test->(LASTREC()))}:show()
>close test

>when I would replace the !test->(append()) with neterr() the same
>result.
>If I check on both with something like
>    DO WHILE test->(DBAPPEND())=FALSE .or. NetErr()

>Then I will endup with about 2500 records.

>It seems like the neterr and append are not always returning false
>when the record is not added. I'm using win95osr2 with the vredir.vxd
>patch on both machines and NT4 SBS as server with ntnfs.

>This code if of course not the final code but a testsample to
>demonstrate the problem.

I think your problem can be traced to the fact that DBAPPEND() always
returns NIL.  Your line of code:

Quote:
>    DO WHILE !test->(DBAPPEND())

*should* bomb even under 5.2.  I suspect your "real" code says

Quote:
>    DO WHILE Test->( DBAPPEND() = .F.

Since DBAPPEND() == NIL relational operators will always return .F.
(not an error), regardless of the success or failure of the append
operation:

? DBAPPEND()               // NIL
? DBAPPEND() = .F.       // .F.
? DBAPPEND() = .T.       // .F.
? DBAPPEND() == .F.     // .F.
? DBAPPEND() == .T.     // .F.

Try something like this:

//----------------------------------------------------------------\\

// 5.2e code

request dbfntx
announce rddsys

//---------------------------------------------------------------
proc main()
local teller

RDDSETDEFAULT("DBFNTX")

use test shared

CLS

FOR teller := 1 TO 1000

   Test->( DBAPPEND() )
   DO WHILE NetErr()
      Test->( DBAPPEND() )
   ENDDO

   Test->( DBCOMMIT() )
   Test->( DBUNLOCK() )


   ?? LTRIM( STR( teller, 4, 0 ) )
   ?? " records"

NEXT

USE
RETURN



Sat, 09 Sep 2000 03:00:00 GMT  
 Why?? Append not ok

Clark,

Thanks for the reply,
I don't have to original testcode here but I think I used something
like

if dbappend()=.f. in the final test.

But the most important thing was that under DOS/Clipper there is no
problem at all. Just under Windows95 with Visual Objects there were
many records gone.
The old patch from microsoft did finally solve the problem.
Still if I test with something like
if dbappend()=.f.
I get about 1 out of 1000 records missing.
Testing on
if Neterr()
always goes right. So Dbappend() is working most of the time but
Neterr is more reliable()

Gerard



Sun, 10 Sep 2000 03:00:00 GMT  
 Why?? Append not ok

Quote:

> Clark,

> Thanks for the reply,
> I don't have to original testcode here but I think I used something
> like

> if dbappend()=.f. in the final test.

> But the most important thing was that under DOS/Clipper there is no
> problem at all. Just under Windows95 with Visual Objects there were
> many records gone.
> The old patch from microsoft did finally solve the problem.
> Still if I test with something like
> if dbappend()=.f.
> I get about 1 out of 1000 records missing.
> Testing on
> if Neterr()
> always goes right. So Dbappend() is working most of the time but
> Neterr is more reliable()

Reread Clarks reply. Dbappend() "ALWAYS" returns NIL, so you cannot use
a return value for anything.


Tue, 12 Sep 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Buttons: Mac OK, Windows not OK

2. Why is '?' OK in a method name and not OK in a variable name ?

3. Enterprise Edition - Why/Why not???

4. Why (or why not) one module per file?

5. why TCL and why not TCL with JAVA

6. Ok, why no methods on strings?

7. Is this legal and if not why not?

8. Why isn't pack append in the man pages

9. why why why oh why why baby

10. HELP: Trying to combined two files (not append)

11. APPEND FROM not working under Win98??

12. failure load.cpp line 4835 VI runs ok in 6i will not load in 6.1

 

 
Powered by phpBB® Forum Software