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:
00472120
Vues:
39
>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
* Is oRS.State or oConn.State more than 0 (Are they already closed?)
if oRS.State>0 && Just grasping at straws
>oRS.CLOSE()
endif
JCF suggested an error service. You could snapshot AERROR() in the ON ERROR.
>oConn.CLOSE()
>oRS = .NULL.
>oConn = .NULL.
>RELEASE ALL
Imagination is more important than knowledge
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform