record locking while insert new record?? 
Author Message
 record locking while insert new record??

I wonder if anyone can help me on this I am using VB6 and SQL 7.0. What I
try to
do is lock a record and also block other from reading that record in one
table
while inserting a new record in another table.

Example : I have 2 tables, Table1 and Table2. Table1 have a few records
which use to store running number. Table2 is use for storing invoice data.
During each insertion of new invoice record to Table2, I need to get the
running number for the invoice from Table1 which then will be use for
inserting new record in Table2 and I will then increment the invoice running
number by 1 in Table1. How can I block the running number of invoice in
Table1 from read by others as soon as I read it until I commit the
transaction. I only want to lock the invoice running number record in Table1
not the whole table. Can it be done? Thanks in advance.



Sat, 03 May 2003 13:49:24 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Inserting a new record between existing records?

2. Inserting a new record between existing records?

3. going to next record after inserting a new record

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

5. adding new records & new record

6. inserting record , table level lock

7. ADO and a counter in a record ->lock a record with mulituser

8. Setting a form to be locked on open of a new record

9. Optimistic Lock: No Error Adding New Record

10. ADP: Insert New Record using ADO

11. INSERTING NEW RECORD RAISES ERROR

12. INSERTING NEW RECORD RAISES ERROR

 

 
Powered by phpBB® Forum Software