Davel
Jun 16th, 1999, 07:47 PM
I have a VB6 app front end to an Access database. I have 2 tables in the
access database in one table there is only one field. This field holds the
current ticket number for a the second table or if you will, the last ticket
number used. The other table has a ticket number field as primary key no
duplicates as well as other fields of information. When I want to add a new
record to table two I access table one and get the current record number and
add one to the number. When the record is saved to table two, I also update
table on with the new current record.
The database is multi user. The problem occurs when two or more people want
to add a new record to the second table. Everyone can retrieve the ticket
number, but on saving only the one to first save is accepted. The others
give an error. This part is fine because I don't want duplicate records.
What I would like to do is when anyone is adding a record I want to stop
anyone else from retrieving the ticket number for the first table. Is there
a way to lock a recordset completely unitl it is released by the person
adding a new record. I don't want to lock the entire database because there
could still be viewing and editing of the second table while a record is
being added. I am using DAO data control.
Any suggestions would be appreciated.
Dave L.
------------------
Dave L
access database in one table there is only one field. This field holds the
current ticket number for a the second table or if you will, the last ticket
number used. The other table has a ticket number field as primary key no
duplicates as well as other fields of information. When I want to add a new
record to table two I access table one and get the current record number and
add one to the number. When the record is saved to table two, I also update
table on with the new current record.
The database is multi user. The problem occurs when two or more people want
to add a new record to the second table. Everyone can retrieve the ticket
number, but on saving only the one to first save is accepted. The others
give an error. This part is fine because I don't want duplicate records.
What I would like to do is when anyone is adding a record I want to stop
anyone else from retrieving the ticket number for the first table. Is there
a way to lock a recordset completely unitl it is released by the person
adding a new record. I don't want to lock the entire database because there
could still be viewing and editing of the second table while a record is
being added. I am using DAO data control.
Any suggestions would be appreciated.
Dave L.
------------------
Dave L