Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO Delete error
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00471924
Message ID:
00471974
Views:
36
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform