Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Delete statement conflict
Versions des environnements
Hi All
i have desinged cursoradapter via ado connection sql server.
Add and Delete commands are working
but when i am editing one record and save it error occurred 'delete statement conflict ...salesdetl', i am not using salesdetl here. why error occurring i dont know i am very try to find out error. so please help me.
here are 2 cursoradapter
1. dchead && primary Table here id is primary key
2. dcdetl && Subtable here subid is primary key
i guess something, when i am going to delete record from dcdetl this error occured
product table is foreign key table, i have make relation with salesdetl,dcdetl
alias=[cursorname2]
cursorschema=[id i,prcode i, qty n(12,3),pnm c(50),subid i]
Selectcmd=[select dcdetl.id,dcdetl.prcode,dcdetl.qty,dcdetl.subid,product.name as pnm from dcdetl inner join prodouct on dcdetl.prcode=product.code]
updatefieldlist=[id,prcode,qty]
updatenamelist=[id,dcdetl.id,prcode dcdetl.prcode,qty dcdetl.qty]
keyfieldlist=[subid]
some code in form
ADD Button
thiform.adding=.t.
sele (cursorname1)
appe blan
delete button
thiform.deleing=.t.
edit button
thiform.editing=.t.
save button
do case
case thisform.adding and thisform.editing
sele (cursorname1)
if tableu(.t.)
sele (cursorname2)
delete for taged=1 &&delete some records when editing
if tableu(.t.)=.f.
aerror(larr)
messageb(larr(2))&& here error occurred when editing
else
=tabler(.t.)
endif
otherwise
sele (cursorname1) && here i am deleted record from primary table and as per relation dcdetl record also deleting no prob here
dele
tableu(.t.)
endc
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement