Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting from a cursoradapter
Message
From
28/04/2004 08:33:44
Eyvind W. Axelsen
Profdoc Norge As
Oslo, Norway
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Deleting from a cursoradapter
Miscellaneous
Thread ID:
00898887
Message ID:
00898887
Views:
55
Hi!

I am using a CursorAdapter to connect to a SQL Server using ADO, and I am having some problems when deleting from a cursor that is made up of data from two related tables.

Here is an example: I have the following two tables:

testchild (id I(4), somedata C(20), foreignkey I(4))
testparent (id I(4), descr C(20))

My selectcmd looks like the following:

Select testchild.id, testchild.foreignkey, testchild.somedata,
testparent.descr
from testchild, testparent
where testparent.id = testchild.foreignkey

Now, I am trying to delete values from the child table by issuing a delete command on the cursor resulting from this select, and then calling tableupdate(). The problem is, however, that data from both parent and child table is deleted, which is not what I want. I have specified the delete-command as follows:

this.DeleteCmd = "delete from testchild where id = ?curTest.id"

I have also tried setting the tables, keyfieldlist, updatenamelist and updateablefieldlist, but the same thing happens.

Any ideas?

Thanks,

Eyvind.
Next
Reply
Map
View

Click here to load this message in the networking platform