Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete statement conflict
Message
De
07/05/2007 22:38:17
Arjun Bagojikop
Dynamic Super Software
Sangli, Inde
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Delete statement conflict
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01223265
Message ID:
01223265
Vues:
59
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
Fil
Voir

Click here to load this message in the networking platform