469,588 Members | 2,741 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,588 developers. It's quick & easy.

How to "unlock" table in error handler routine?

Is there a way to unlock a table so a subroutine can complete?
frmMain!frm0 has got a lock on a table I need to do stuff with.

Error Number 3211: The database engine could not lock table 'tblRecords'
because it is already in use by another person or process.

I've tried this:

HandleErr:
Select Case Err.Number
Case 3211 'could not lock table
Forms!frmMain!frm0.Requery
Resume Next
Case Else
modHandler.LogErr (Me.Form.Name)
Resume Exit_Here
End Select
End Sub

But I get other errors... is there a better way to "unlock" tblRecords?
What does it mean when a table is locked, anyway?

Thanks!
Nov 12 '05 #1
1 2963
I have a multi-user app in which a function generates job numbers. The
function to get a new job number tests to see if the record is locked, if no
then lock the record, update and then unlock it. If locked, then wait a
short time and try again, etc. If too many waits ( this has never
happened ) then bail and display a message.

John Bickmore
www.BicycleCam.com
www.Feed-Zone.com

"deko" <dj****@hotmail.com> wrote in message
news:bZ*****************@newssvr29.news.prodigy.co m...
Is there a way to unlock a table so a subroutine can complete?
frmMain!frm0 has got a lock on a table I need to do stuff with.

Error Number 3211: The database engine could not lock table 'tblRecords'
because it is already in use by another person or process.

I've tried this:

HandleErr:
Select Case Err.Number
Case 3211 'could not lock table
Forms!frmMain!frm0.Requery
Resume Next
Case Else
modHandler.LogErr (Me.Form.Name)
Resume Exit_Here
End Select
End Sub

But I get other errors... is there a better way to "unlock" tblRecords?
What does it mean when a table is locked, anyway?

Thanks!

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

134 posts views Thread by James A. Donald | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.