VB6 ERROR HANDLER
Posted on 2011-05-07
Hi, i have a function in my application which inserts value to the db. if a user try to insert a record that violates the unique key constraint i have used an err handler in the function like
'' some code that retrieves the max val from the db and increments by 1 and does some othr code and inserts the rec which will be unique.
If Err.Number = -2147217873 Then
MsgBox "Error :" & Err.Number & " - " & Err.Description, vbCritical
My question is, if two users gets the err handler at 2 diff times it works as it picks diff max vals from db.
But will this loop go infinitely if two or more users hits the err handler and picks the max val, adds 1 to it and tries to insert at the same time?