Tadej
Jun 15th, 2000, 03:38 AM
I have this a transaction that goes like this:
Dim rst1 As Recordset
Dim rst2 As Recordset
Dim MaxID, i
wspc.BeginTrans
Set rst1 = dbs.OpenRecordset("SELECT Max(ID) FROM Table1")
tbl.MoveFirst
MaxID = tbl.Fields(0)
rst1.Close
Set rst1 = dbs.OpenRecordset("Table1")
Set rst2 = dbs.OpenRecordset("Table2")
For i = 1 To numberOfEntries
rst1.AddNew
rst1.Fields("ID") = MaxID + i
'.
'.
rst1.Update
rst2.AddNew
'.
'.
rst2.Fields("ID_Table1") = MaxID + i
rst2.Update
Next i
rst1.Close
rst2.Close
wspc.CommitTrans
I would like to disable other users to read from or write to both Table1 and Table2 (lock them) while the transaction is active.
If anyone knows how to do this than please answer.
Thanx
Tadej
Dim rst1 As Recordset
Dim rst2 As Recordset
Dim MaxID, i
wspc.BeginTrans
Set rst1 = dbs.OpenRecordset("SELECT Max(ID) FROM Table1")
tbl.MoveFirst
MaxID = tbl.Fields(0)
rst1.Close
Set rst1 = dbs.OpenRecordset("Table1")
Set rst2 = dbs.OpenRecordset("Table2")
For i = 1 To numberOfEntries
rst1.AddNew
rst1.Fields("ID") = MaxID + i
'.
'.
rst1.Update
rst2.AddNew
'.
'.
rst2.Fields("ID_Table1") = MaxID + i
rst2.Update
Next i
rst1.Close
rst2.Close
wspc.CommitTrans
I would like to disable other users to read from or write to both Table1 and Table2 (lock them) while the transaction is active.
If anyone knows how to do this than please answer.
Thanx
Tadej