Help with record locking - duplicate key problem... 
Author Message
 Help with record locking - duplicate key problem...

I am working on a POS application where transactions
are being entered very rapidly. To generate a transaction
ID which is my Header and Detail record key, I am
getting the last receipt # used for a given date and
register and incrementing it by one. I am using DB.Execute
statements with straight SQL to insert records into the
database.

The problem is that sometimes it appears that the
records are not getting written to the database fast
enough and I am getting duplicate keys. The result
is two tickets being printed from the system with
the same ticket # and obviously only one record in
the database. Is this due to record locking or
something else? How do I handle this? Should I use the
Idle method to free locks on the database? It appears in
the help file that freelocks only affects open dynasets?

Any help would be appreciated...
T.

---------------------------------------------
* Terry Myers - Senior Systems Engineer     *
* Halo Technologies                         *
* OKC - 405.330.2400   Tulsa - 918.585.2207 *

---------------------------------------------



Wed, 10 Nov 1999 03:00:00 GMT  
 Help with record locking - duplicate key problem...

Terry D. Myers:

   I'm too developing a POS application. To solve this problem I defined
my table with one Primary Key of the type 'Counter' and one date type
field, to stamp the date/time of insertion.
  Then my app inserts the records with a SQL string, and if I need the
record Id, then request for it with a SQL 'Select' statement, looking
for the date/time stamp.

   May be this can help you,

Federico Cirett
=)



Fri, 19 Nov 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I am getting duplicate records, I mean everything is duplicate even Access record number

2. Removing duplicate records locks up Outlook

3. Record Locking - Is there a way to test to see if a record has been locked

4. HELP! Access 2.0 Record Locking Problems

5. Duplicate Value in primary key - problem

6. problem catching duplicate key

7. HELP: Duplicate Keys in Access Database

8. Need Help with Duplicate Key Error

9. HELP: Duplicate keys in Access Database

10. copy/duplicate record problem

11. newbie problem with duplicate records

12. Duplicate Records Problem?

 

 
Powered by phpBB® Forum Software