Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO Delete error
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00471924
Message ID:
00471974
Vues:
31
>I am sure it is something I am overlooking. Here is some psudo code that simulates the problem.
>
>'PPLUS' is a DSN that has been setup with the vfp driver for my VFP dbc.
>
>#INCLUDE "adovfp.h"
>oRS = CREATEOBJECT("ADODB.RecordSet")
>oConn = CREATEOBJECT("ADODB.Connection")
>pcOpen = 'PPLUS'
>oConn.OPEN(pcOpen)
>oRS.CursorType = adOpenStatic
>oRS.LockType = adLockBatchOptimistic
>oRS.CursorLocation = adUseClient
>oRS.OPEN("select * from mastcoil", pcOpen)
>oRS.MoveFirst() && Just move to the first rec and delete
>IF oRS.Supports(adDelete) && for testing purposes.
> oRS.DELETE(AdAffectCurrent)
> oRS.UPDATEBATCH()
>ENDIF
>oRS.CLOSE()
>oConn.CLOSE()
>oRS = .NULL.
>oConn = .NULL.
>RELEASE ALL

OK, you can also check if the recordset/provider supports batch updates with ors.Supports(adUpdateBatch). If it passes this test then I would look into the errors collection of you oconn object. Something like:
For each oErr in oConn.Errors
  ? oErr.Number, oErr.Description, oErr.NativeError
Next
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform