Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete record and CursorAdapter
Message
 
 
To
14/05/2003 10:09:36
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00788174
Message ID:
00788188
Views:
33
Do all 3 records have the same value for the ID field? If not, what does your data look like? FWIW, I also would leave out the ID field from the UpdatableFieldList and UpdateNameList properties [if it is a PK field]. The PK field should not be updated.

>I'm sure I'm missing something very obvious, but why does the following code cause all 3 records in the table to be marked for deletion?
>
>Thanks,
>Pat
>
>OPEN DATABASE x
>SET MULTILOCKS ON
>lv1Cursor = CREATEOBJECT('cursoradapter')
>WITH lv1Cursor
> .alias = 'lv1cursor'
> .datasourcetype = 'Native'
> .selectcmd = "select * from lv1"
> .tables = 'lv1'
> .keyfieldlist = 'id'
> .updatableFieldList = 'id,name,address,city,state'
> .UpdateNameList = 'name lv1.name,address lv1.address,city lv1.city,state lv1.state,id lv1.id'
> IF .cursorFill()
> GO top
> * Move to the second record of a 3 record table
> SKIP
> DELETE NEXT 1
> TABLEUPDATE(1)
> ELSE
> MESSAGEBOX("Error accessing data")
> ENDIF
>ENDWITH
>CLOSE DATABASES all
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform