Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append recs goes overlaped
Message
De
17/01/2002 19:06:50
Cristian Tenea
Aquila Part Prod Com
Ploiesti, Roumanie
 
 
À
17/01/2002 18:13:22
Cristian Tenea
Aquila Part Prod Com
Ploiesti, Roumanie
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00606423
Message ID:
00606488
Vues:
34
>Would it be possible to see your code? I have from 25 to 250 users on VFP applications I have created and we do not have these problems.

Yes, thanks for your help, I have a milion headaches every day from that behaviour.

the code are in methods of baseform class on wich are based all forms
the tables are optimistic table buffer

proc new - adds a new record to parent and child
local ldatamaster,ldataslave,llink,lmasterlink

ldatamaster=thisform.datamaster
ldataslave=thisform.dataslave
llink=thisform.datalink
lmasterlink=thisform.datamaster+'.'+thisform.datalink

if dpageform::new()
  if cursorgetprop('SourceType',ldataslave)=3
    if this.autoitem
      insert into (ldataslave) (&llink) values (&lmasterlink)
    endif
    thisform.refreshform()
  else
    =requery(ldataslave)
  endif
endif
proc newgrid - adds a record to child
local ldatamaster,ldataslave,llink,lmasterlink

ldatamaster=thisform.datamaster
ldataslave=thisform.dataslave
llink=thisform.datalink
lmasterlink=thisform.datamaster+'.'+thisform.datalink

sele (ldataslave)
delete for empty(&llink)
append blank
replace &llink with &lmasterlink
thisform.refreshform()
thisform.pageframe1.page1.gridslave.setfocus()
thisform.pageframe1.page1.gridslave.activatecell(thisform.pageframe1.page1.gridslave.activerow,1)
proc save - save all data
local ldatamaster,ldataslave,llink,lmasterlink,lerror

ldatamaster=thisform.datamaster
ldataslave=thisform.dataslave
llink=thisform.datalink
lmasterlink=thisform.datamaster+'.'+thisform.datalink

thisform.activarecimp  && sets a focus on first textbox
sele (ldatamaster)

if thisform.writebuffer()
	begin transaction
	lerror=(txnlevel()=0)
	if !lerror
		if getfldstate(-1)=replicate("1",fcount()+1)
			=setfldstate(2,2)
		endif
		=reccount()
		lerror=!tableupdate(.T.)
        sele (ldatamaster)
		FLUSH
		if !lerror
			select (ldataslave)
			=reccount()
			lerror=!tableupdate(.T.)
		endif
		if !lerror
			end transaction
			FLUSH
			sele (ldatamaster)
			GO (RECNO())
			wait window nowait 'Informatii salvate!'
			??chr(7)
		else
			thisform.lockscreen=.t.
			rollback
			thisform.refreshform()
			thisform.lockscreen=.f.
			=aerror(laerror)
			thisform.error(laerror[1],laerror[2],0)
		endif
	endif
endif

sele (ldatamaster)
thisform.refreshform()
return !lerror
=reccount(), flush was addeded in try to resolve the problem
ldatamaster - alias of parent table
ldataslave - alias of child
llink - the name of id field relating the two tables
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform