Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete record and CursorAdapter
Message
 
 
À
14/05/2003 10:09:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00788174
Message ID:
00788188
Vues:
34
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform