Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 6th, 2004, 08:29 AM
Registered User
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Record locking - user needs the next queued record

Thanks for any direction on this...

I have an Access front-end (project .adp file) accessing a SQL back-end DB. The data is a basic call list for a credit/collection center.

Callers are in various "call groups" that bring up records based on various criteria - regional, dollar amount owed, etc. The queues are not necessarily mutually exclusive - meaning records in one queue can possibly show up in another queue.

I do the above with simple views that query the unviewed/uncalled records. After a record is contacted, it drops from the list.

I need a way to ensure that when someone opens a record, no one else can open that record. Here is the process.

User clicks a "Next Record" button.

I have a function called "GetNextRecord" that performs the query based on their call group. The query includes the top 25 records based on the criteria (just to reduce the queries overall size). The next unique key is returned and then back on my Access form I set my recordset to that unique key.

AT the time the form is opened, the record is "stamped" for the user who opened the form. At this point, the record drops off the queue because all the views exclude records with a user code saved to them.

However, if two users simultaneously hit next record, they can grab the unique key prior to the record being stamped.

How do I remedy this. Can I do it at the query prior to returning the record number. For instance, using the following:

Open the query so that a record can be updated - returning 25-50 records.
Starting at the first record, stamp the record for that user if it hasn't already been stamped. Return the number.

If it has been stamped in the time that they created/pulled the query, move to the next record in the recordset and try the same.

I hope this made sense. Your input is greatly appreciated.

Matthew Moran
The IT Career Builder's Toolkit

Similar Threads
Thread Thread Starter Forum Replies Last Post
Record Locking & Transactions in Strongly Typed DS Kia Visual Basic 2005 Basics 4 July 23rd, 2007 06:23 AM
Record locking in an ASP application James Diamond Classic ASP Databases 10 July 6th, 2006 10:28 AM
ADO Record Locking pjohanne VB Databases Basics 3 March 9th, 2006 05:42 AM
Record locking Stanny Access 1 February 11th, 2006 12:57 PM
Locking a record Bune SQL Server 2000 3 August 26th, 2003 09:50 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.