
Originally Posted by
jgelpi16
Khalid - What if you created a single table that exists in your "main" back-end. Use it as a "tracking" table. When a user begins to edit a record append the recordID, and whatever other identifiers you need, to the table. When other users try to begin edits on records reference that table, if the recordID/PK field exists in that one table, prevent the user from editing. Would that work with your logic/structure?
This is also a good idea of creating a temp table on the back-end and record the editing table FK to that temp table and once editing complete delete the edited record from the temp table,
When I drag down the application, I found that its not possible only to get all the data for all the tables locally, coz there are APPEND issues, newly local generated IDs issues, Subform Data issues, and much more... I have to keep some tables connected and linked to the main database to avoid all these hurdles.
I am thinking to do:
Code:
Public Sub OpenCon()
Set Connection = New ADODB.Connection
' Open a database connection using a client library cursor.
With Connection
.ConnectionString = "myConnectionString"
.CursorLocation = adUseClient
.Open
End With
End Sub
and then call the OpenCon function to open the adLockPessimistic recordset.
Code:
Private Sub Command11_Click()
OpenCon '- Open the connection
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
With rst
.ActiveConnection = Connection
.CursorType = adOpenKeyset
.LockType = adLockPessimistic
.Open "Select * FROM myTable Where ID = 4"
!MyName = Me.MyName
!MyNumber = Me.MyNumber
.Update
.Close
End With
Connection.Close
Set Connection = Nothing
End Sub
What's your openion please?
Thank you for your consideration and the idea!