Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bad index table
Message
From
19/11/2001 05:11:21
Cristian Tenea
Aquila Part Prod Com
Ploiesti, Romania
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Bad index table
Miscellaneous
Thread ID:
00583350
Message ID:
00583350
Views:
54
Hi all,

In several applications wich are made based on same framework (clases build by myself) things are go wrong with indexes in saved records to tables one-to-many forms. If in application work one user everything is ok, but when working more users it's happening to save bad entryes in indexes (primary or candidate).
When this happens there are NO crushes, power failures, net failures or other things.
Supose we have 2 tables T1MASTER and T2CHILD with IDT as primary and link field and in T1MASTER candidate field NRDOC; when saving a new record there are possibilities to get T2CHILD recs saved, in T1MASTER get error NRDOC index violated; when open T1MASTER and activate index NRDOC and search for record just entered the pointer take me to a record with other NRDOC

The save procedure in clases are like this:

local ldatamaster,ldataslave,llink,lmasterlink,lerror

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

thisform.activarecimp
sele (ldatamaster)

if thisform.writebuffer()
begin transaction
lerror=(txnlevel()=0)
if !lerror
if getfldstate(-1)=replicate("1",fcount()+1)
=setfldstate(2,2)
endif
lerror=!tableupdate()
if !lerror
select (ldataslave)
lerror=!tableupdate(.t.)
endif
if !lerror
end transaction
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


Thanks in advance
Next
Reply
Map
View

Click here to load this message in the networking platform