Advertisement

05.21.2008 at 08:55AM PDT, ID: 23421382 | Points: 500
[x]
Attachment Details

Pessimistic Locking with Access ADO and SQL Server

Asked by Locky123 in MS SQL Server, Microsoft Access Database, Access Coding/Macros

Tags: Microsoft, Access / SQL Server

Hello All

I am trying to get a definitive answer as to whether it is possible to acheive a pessimistic lock with ADO.
I am using an MS Access 2003 .mdb front end connected to SQL Server 2005.

I have a routine that creates a recordset that I need to be locked from the point of opening (no .edit command in ADO) to the point the update command is issued.

I have opened a connection using the sqloledb provider and set it's cursor locaion to adUseServer (I believe this is the default anyway)

I have then instantiated a recordset and set its 'Lock Type' to pessimistic, 'Cursor Type' to keyset and 'Cursor Location' to server side.

I have tried all manner of combinations of these parameters and I simply cannot achieve a lock.  I can open a new instance of the front end and happily update the record while to other instance supposedly has it locked.

I know that using an sp is probably the way to go, but I don't know enough T-SQL to be confident enough to produce one - and in any case, the options are there, so they should work surely!

I've been at this for three solid days now and it's driving me nuts!

Any help greatly appreciated!

AndyStart Free Trial
[+][-]05.21.2008 at 09:16PM PDT, ID: 21620844

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 11:57PM PDT, ID: 21621490

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 03:59AM PDT, ID: 21622594

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 04:18AM PDT, ID: 21622698

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 04:29AM PDT, ID: 21622755

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 04:52AM PDT, ID: 21622878

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628