Article ID: 108467
Article Last Modified on 1/8/2003
Sub Form_Load ()
Dim i As Integer
Dim db As Database
Dim tb As table
On Error GoTo ExclusiveErr
Const DB_DENYWRITE = &H1 ' Constant defined in DATACONS.TXT file
Const DB_DENYREAD = &H2 ' Constant defined in DATACONS.TXT file
Set db = OpenDatabase("C:\VB3\BIBLIO.MDB")
Set tb = db.OpenTable("authors", DB_DENYREAD + DB_DENYWRITE)
' To open shared access, use: Set tb = db.OpenTable("authors", 0)
MsgBox "Database & table opened successfully, denying read & write."
'PlaceDataInControls
EndExclusiveOpen:
Exit Sub
ExclusiveErr:
Select Case Err
Case 3262
MsgBox "Table is locked. You cannot open it exclusively. Try shared."
'optExclusive.Value = False
Resume EndExclusiveOpen
Case 3261
MsgBox "Table exclusively locked by another user -- cannot open."
End
Case Else
MsgBox Err & " " & Error$
End Select
End Sub
Set tb = db.OpenTable("authors", 0)
This opens the table with shared access, the default.
Additional query words: 3.00
Keywords: KB108467