-
Not much help from me.
I do not know enough to answer this question, but nobody else seems interested, so here are some thoughts.
The problem you are talking about has to be mediated at the machine language level by the Operating System.
If it is not being done automatically by Access or the OS, then you have to do research and find an API call or use some special syntax to Lock a record (or the file) and/or query for the existence of a lock before attempting to edit the record.
On most systems I have worked on, there was a Query-and-lock conditional which either gave you access (and locked the object) or else indicated that the record/file was in use.
-
I'm not an expert on ADO there is extensive documentation at msdn.microsoft.com/library however.
I think if you use
Code:
Dim rstTemp As New ADODB.Recordset
rstTemp.Open "Table Name", cnnDb, adOpenKeyset, adLockPessimistic, adCmdTable
The DB engine will raise an error when the second user tries to run the update method. I'm not exactly sure of this as I have a feeling that it depends on the DB engine. Ie Jet (Access) does it one way and SQL Server does it another way.
I know it's a common problem so see if you can find anything on Microsofts Site.
[Edited by mattbrown on 12-05-2000 at 03:04 PM]