Click to See Complete Forum and Search --> : Is adLockPessimistic really doing its job?
bbUFO
Jul 11th, 2000, 03:57 PM
I use ADO2.5 + Oracle + VB6 sp4
rst.Open "select * from test", conn, adOpenDynamic, adLockPessimistic, adCmdText
it doesn't lock the record until I run the rst.Update
Why????
PaulLewis
Jul 11th, 2000, 10:42 PM
You gave me quite a scare so I checked my code and I don't have a problem.
Difference might be that I specify adCmdTable when opening my table for mods.
The main reason for this is that I have Class wrappers for all of my data objects so that I have a common "Interface" to use. All of my data objects eventually call upon my data source wrapper to handle updates, deletes or adds.
Unfortunately I don't have time to do a test for you , but if you used adCmdTable instead of adCmdText, you might find it works? When I changed my working code to open with adCmdText parameter I could not update the database.
Oh, and I am also only opening an Access db, not Oracle. So maybe the providers do their locking differently. All the manual says is : "Pessimistic locking, record by record—the provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source immediately upon editing." So it is possible that Oracle has their own interpretation of "does what is necessary"
Hope it helps
Paul Lewis
bbUFO
Jul 14th, 2000, 01:48 PM
Thanks.
Yes, you were right. It works for MS Access, but not for Oracle.
Now I need to find a way in VB, which can lock the Oracle record.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.