Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 6th, 2004, 08:29 AM
Registered User
 
Join Date: Dec 2004
Location: Cave Creek, AZ, USA.
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
http://www.cbtoolkit.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.