Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete statement conflict
Message
From
07/05/2007 22:38:17
Arjun Bagojikop
Dynamic Super Software
Sangli, India
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Delete statement conflict
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01223265
Message ID:
01223265
Views:
64
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
Next
Reply
Map
View

Click here to load this message in the networking platform