Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append a new record
Message
De
06/02/2002 02:54:48
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Append a new record
Divers
Thread ID:
00615893
Message ID:
00615893
Vues:
40
Hi all,

I have the following program. Every time, when I run there is an error message: "Uniqueness of index key "cross_key" is violated" then I check the db, I find one record is add but the key fields(CROSS_ID, CURM_D) are null.

set exac on
sele pc_quota
set order to cross_key
if findrecord == .F.
allocat_array(1,1) = '01/2001'
endif

i =1
count_u =0
count_new =0
j = alen(allocat_array,1)
if messagebox('Are you sure to update?',4,'Confirm message') = 6
for y = 1 to totalmonth +1
txt_d = 'txt_d' + allt(str(y))
txt_q = 'txt_q' + allt(str(y))

select pc_quota
scan for thisform.&txt_d..value == allocat_array(i,1) and cross_id == crossid
if found()
replace curm_quo with allt(thisform.&txt_q..value )
count_u = count_u+1
i=i+1
else
append blank
replace cross_id with crossid
replace curm_d with thisform.&txt_d..value
replace curm_quo with thisform.&txt_q..value
count_new = count_new+1
endif
endscan
if i>j
i=1
endif

endfor
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform