|
-
Jun 15th, 2000, 03:35 AM
#1
Thread Starter
Member
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
-
Jun 15th, 2000, 03:55 AM
#2
Ok don't have vb on this machine.....but
Look at the mdb Exclusive property. If set to true then only the person with the mdb open and get access to it.
Something Like
Dim dbStuff as Database
dBStuff = OpenDatabase(whatever)
dbStuff.Exclusive = True
Will have a look back at the office and get back to ya on it.
-
Jun 15th, 2000, 04:06 AM
#3
Thread Starter
Member
Thank you, but I dont want to open the database
exclusively because I want to allow other users to
access other tables in the database.
I only want to restrict access to those two tables.
Tadej
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|