On 12/15/2020 12:59 PM, MB Software Solutions, LLC wrote:
VFP9SP2 - Citrix/VMWare server, Win10 desktop image on client
My error handling tripped on this simple line:
INSERT INTO broker!doclinks (ifileid,idoctypeid,crange) VALUES (thisform.oFile.iid,liDocTypeID,ALLTRIM(loObj.txtRange.value))
VFP Help says this about Error 108:
Visual FoxPro 9.0 SP2 File is in use by another user (Error 108) You have attempted a USE, DELETE, or RENAME command on a file that is being used by another user on a network.
I don't see why this line of code would throw an Error 108. I guess I'll add a simple TRY/CATCH around it to retry it "N" number of times (via DO WHILE loop with flag and counter), but tossing this out to the group for your thoughts.
Thanks, --Mike
I wrapped this code around it:
*** mjb 12/15/2020 - added try/catch and retry attempts llPass = .F. liTries = 0 DO WHILE NOT llPass AND liTries < 10 TRY liTries = liTries + 1 INSERT INTO broker!doclinks (ifileid,idoctypeid,crange) VALUES (thisform.oFile.iid,liDocTypeID,ALLTRIM(loObj.txtRange.value)) llPass = .T. CATCH TO loException WHEN loException.ErrorNo = 108 WAIT WINDOW TIMEOUT 1 "Unable to insert document link. Reattempting " + ALLTRIM(STR(10-liTries)) + " more times..." INKEY(2) && wait 2 seconds CATCH TO loException oUtils.Alert(loException.Message,16,"Problem inserting doc link") ENDTRY ENDDO && WHILE NOT llPass AND liTries < 10