In the sub or function where you execute your sql statement, add some additional error handling. In your error routine, check for the err.number. If it is a locking error, do an err.clear and use a goto (did I just say that) to a label just above your sql execute statement and let it try again.
To avoid a possible endless loop, put a counter in there and if it get to 10 or whatever you think is acceptable, allow the error to raise.
Brian T. Wiehoff