Click to See Complete Forum and Search --> : Need a Opinion


October 13th, 1999, 06:42 AM
I have got the code already but will look at more. I need to know if I going in the right direction. I have five station that I have loaded my program on. The data base is located on the sever. The problem I’m having is that when more then one person update or edit the database is damages it. So with the help of other I have coded the update or edit part of the program with a Lockedit = True using pessimistic locking. Is this direction I should be going.
This is how I'm using lockedits property. See what it look like to you. An E-mail back at sfowler@mastnet.net
Public Sub TimeOut(pInterval As Single)
Dim sngTimer As Single
sngTimer = Timer

Do While Timer < sngTimer + pInterval
DoEvents
Loop
End Sub

Private Sub Command1_Click()
Static intTry As Integer
dim DB as Database
Dim A as String
Dim Dbs as Recordset
On Error GoTo errorh
set DB = Opendatabase("database Path")
set Dbs = DB.OpenRecordset("Table Name")
Dbs.Lockedits = False
Dbs.Edit
Dbs(A) = Text1
Dbs.Update
Dbs.Close
DB.Cose
Continue:
'Here trap your errors
errorh:
Select Case Err.Number
Case 3262, 3186, 3187, 3188, 3189
TimeOut 5
MsgBox "Time"
If intTry = 1 Then 'If you have 2 tries
If MsgBox("Do you want to try again?", vbRetryCancel) = vbRetry Then
intTry = 0
GoTo Continue
Else
intTry = 0
Exit Sub
End If
End If
intTry = intTry + 1
Resume
GoTo Continue
End Select
End Sub