cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
%3CLINGO-SUB%20id%3D%22lingo-sub-339784%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3EHow%20to%20prompt%20a%20%22%20File%20in%20Use%22%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-339784%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI'm%20currently%20creating%20a%20JMP%20file%20which%20acts%20as%20a%20database.%20Therefore%20I%20would%20like%20to%20prompt%20a%20%22File%20in%20use%22%20message%20and%20keep%20the%20file%20locked%20for%20editing%20when%20someone%20else%20already%20opened%20the%20database%20and%20is%20making%20changes%20to%20the%20file.%20For%20example%2C%20the%20same%20message%20you%20get%20when%20you%20open%20an%20Excel%20file%20on%20a%20server%20location%20that%20is%20already%20in%20use%20by%20someone%20else%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22file%20in%20use%20message.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22file%20in%20use%20message.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22file%20in%20use%20message.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22file%20in%20use%20message.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F28754i41DD73882C69D926%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22file%20in%20use%20message.png%22%20alt%3D%22file%20in%20use%20message.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20think%20I%20already%20found%20a%20part%20of%20the%20answer%20in%20the%20following%20Community%20post%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FMulti-User-Access%2Fm-p%2F109626%23U109626%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-forum-thread%20lia-fa-icon%20lia-fa-forum%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3EMulti-User%20Access%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20I'm%20correct%20I%20would%20still%20need%20to%20figure%20out%20how%20to%20lock%20the%20table%20if%20it%20is%20opened%20by%20another%20user.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECould%20someone%20please%20help%20with%20creating%20such%20a%20script%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-339784%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CLINGO-LABEL%3EData%20Access%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-341069%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20How%20to%20prompt%20a%20%22%20File%20in%20Use%22%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-341069%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIt%20will%20probably%20work%20in%20JMP%2014.%20I%20reported%20the%20JMP%2015%2F16%20issue%20I%20was%20seeing.%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20must%20make%20it%20work%20in%2015%2C%20you%20can%20do%20something%20like%20this%20function%20I%20used%20in%20the%20FileSnapper%20add-in.%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%20FileSnapper%3AisFileOpenElsewhere%20%3D%20Function(%20%7Bfilepath%7D%2C%20%7Bdt%2C%20savelog%7D%2C%0A%20%20If(%20endswith(filepath%2C%22.jmp%22)%20%26amp%3B%20File%20Exists(%20filepath%20)%2C%0A%20%20%20dt%20%3D%20Open(%20filepath%2C%20private%20)%3B%20%20%0A%20%20%20savelog%20%3D%20Log%20Capture(%20dt%20%26lt%3B%26lt%3B%20save%20)%3B%0A%20%20%20close(dt%2C%22nosave%22)%3B%0A%20%20%20Length(%20savelog%20)%20!%3D%200%3B%20%2F%2F%20error%20message%20means%20another%20JMP%20has%20dt%20open%0A%20%20%2C%20%2F%2F%20else%0A%20%20%200%20%2F%2F%20not%20open%20if%20not%20exists%20%0A%20%20)%0A%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EIt%20works%20by%20trying%20to%20save%20the%20file%20as%20soon%20as%20it%20is%20opened%20and%20catching%20the%20log%20message.%20If%20there%20is%20no%20log%20message%2C%20the%20save%20worked.%20You'd%20want%20to%20rearrange%20that%20a%20bit%2C%20probably%20not%20closing%20the%20table%20if%20the%20save%20was%20successful%2C%20and%20not%20using%20%3CEM%3Eprivate%3C%2FEM%3E.%20The%20downside%20is%20if%20the%20file%20is%20very%20big%2C%20the%20extra%20save%20might%20take%20some%20time%2C%20and%20it%20doubles%20the%20chance%20of%20having%20a%20power%20failure%20during%20a%20save%2C%20corrupting%20the%20data.%20(For%20FileSnapper%2C%20the%20file%20is%20a%20sentinel%2C%20small%2C%20about%20to%20be%20deleted%2C%20and%20re-created%20each%20time%2C%20so%20it%20works%20OK.)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-341045%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20How%20to%20prompt%20a%20%22%20File%20in%20Use%22%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-341045%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EOk%2C%20thanks%20for%20looking%20into%20this%20Craig.%3C%2FP%3E%3CP%3EI'll%20try%20setting%20up%20the%20script%20from%20David%20in%20my%20JMP%20file.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-339926%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20How%20to%20prompt%20a%20%22%20File%20in%20Use%22%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-339926%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHmm.%20I%20can%20see%20it%20works%20in%20JMP%2014%2C%20but%20maybe%20not%2015.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-339904%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20How%20to%20prompt%20a%20%22%20File%20in%20Use%22%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-339904%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EDavid's%20script%20has%20the%20code%20that%20checks%20for%20the%20visible%20indication%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F28764iB52CA662BB094D01%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22LockedFile.PNG%22%20alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-339902%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20How%20to%20prompt%20a%20%22%20File%20in%20Use%22%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-339902%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EThanks%20for%20the%20respons%20Craige.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWould%20it%20be%20possible%20to%20prompt%20a%20message%2Fwarning%20that%20the%20file%20is%20already%20in%20use%20by%20someone%20else%3F%20Currently%2C%20the%20second%20user%20could%20be%20unaware%20that%20the%20file%20is%20already%20opened%20by%20another%20user.%20So%20if%20the%20second%20user%20makes%20any%20changes%20to%20the%20file%2C%20these%20changes%20cannot%20be%20saved%20to%20the%20orginal%20file.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-339880%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20How%20to%20prompt%20a%20%22%20File%20in%20Use%22%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-339880%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EA%20JMP%20table%20is%20locked%20for%20writing%20by%20the%20first%20user%20that%20opens%20it.%20Subsequent%20users%20get%20read-only%20access%20(they%20can't%20save%20their%20changes).%20The%20script%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4536%22%20target%3D%22_blank%22%3E%40David_Burnham%3C%2FA%3E%26nbsp%3Bwrote%20assumes%20the%20user%20with%20the%20lock%20will%20close%20the%20table%20fairly%20soon%20(200%20tries)%20and%20then%20opens%20the%20table%20for%20the%20new%20user%2C%20which%20should%20get%20the%20lock%20for%20the%20new%20user.%20It%20might%20work%20pretty%20well%20for%202%20or%203%20users%20that%20use%20a%20carefully%20written%20program%20to%20update%20the%20table.%20It%20is%20not%20for%20a%20user%20that%20might%20open%20the%20table%20then%20go%20to%20lunch%20without%20closing%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-743872%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20prompt%20a%20%22%20File%20in%20Use%22%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-743872%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECan%20you%20post%20the%20test%3F%20And%20is%20the%20file%20a%20network%20file%20or%20a%20local%20file%3F%20I'm%20not%20sure%20what%20JMP%20or%20the%20OS%20might%20do%20differently%2C%20but%20at%20least%20sometimes%20I%20think%20JMP%20saves%20to%20an%20alternate%20file%2C%20then%20deletes%2Frenames%2Fswaps%20to%20make%20the%20window%20for%20a%20power%20loss%20failure%20as%20small%20as%20possible.%20It%20could%20be%20that%20process%20is%20getting%20in%20the%20way.%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F3022%22%20target%3D%22_blank%22%3E%40briancorcoran%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-744192%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20prompt%20a%20%22%20File%20in%20Use%22%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-744192%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20problems%20are%20worse%20with%20a%20network%20drive%20(on%20in%20my%20instance)%20with%20a%20file%20on%20OneDrive.%26nbsp%3B%20But%20my%20testing%20has%20been%20with%20a%20local%20file.%26nbsp%3B%20Windows%2010%2C%2C%20JMP%2017.%3C%2FP%3E%0A%3CP%3EThe%20scripts%20%E2%80%9Clocktest1%E2%80%9D%20and%20%E2%80%9Clocktest2%E2%80%9D%20are%20identical%20except%20that%20the%20first%20script%20updates%20column%201%20of%20the%20results%20table%20whereas%20the%20second%20script%20updates%20the%20column%202.%3C%2FP%3E%0A%3CP%3EBy%20running%20each%20script%20simultaneously%20in%20separate%20JMP%20instances%20it%20is%20possible%20to%20stress-test%20the%20logic%20for%20handling%20file-locks.%3C%2FP%3E%0A%3CP%3ELine%2075%20of%20the%20scripts%20contains%20the%20path%20for%20the%20results%20table.%26nbsp%3B%20Place%20the%20results%20table%20in%20a%20suitable%20location%20and%20update%20the%20path%20variable%20to%20point%20to%20this%20location.%3C%2FP%3E%0A%3CP%3EOpen%20a%20JMP%20session%20and%20open%20locktest1.%26nbsp%3B%20Show%20the%20embedded%20log.%3C%2FP%3E%0A%3CP%3EOpen%20a%20second%20JMP%20session%20and%20open%20loctest2%2C%20with%20an%20embedded%20log.%3C%2FP%3E%0A%3CP%3ERun%20the%20two%20scripts%20(I%20run%20the%20first%2C%20wait%20until%20the%20log%20shows%20i%3D5%20and%20then%20run%20the%20second%2C%20but%20that%20is%20just%20superstition).%3C%2FP%3E%0A%3CP%3EThe%20loop%20defined%20on%20line%2079%20performs%2050%20iterations.%26nbsp%3B%20If%20the%20two%20scripts%20finish%20successfully%20then%20the%20outcome%20should%20be%20that%20the%20results%20table%20contains%20numbers%201%20to%2050%20in%20each%20of%20the%20two%20columns.%3C%2FP%3E%0A%3CP%3EThere%20is%20a%20table%20script%20that%20will%20allow%20you%20to%20reset%20the%20table%20contents.%3C%2FP%3E%0A%3CP%3EIn%20practice%2C%20there%20are%203%20possible%20failure%20modes%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EOne%20or%20more%20%E2%80%9Cunable%20to%20get%20end%20of%20file%20marker%E2%80%9D%20messages%20are%20displayed.%26nbsp%3B%20This%20error%20occurs%20when%20saving%2C%20and%20it%20is%20not%20possible%20to%20save%20the%20results.%26nbsp%3B%20Therefore%20there%20will%20be%20some%20missing%20values%20in%20the%20results%20table.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3CLI%3EAt%20some%20point%2C%20the%20results%20table%20will%20vanish.%26nbsp%3B%20If%20the%20file%20cannot%20be%20found%20the%20scripts%20abort%20execution%20with%20a%20%E2%80%9Cfile%20not%20found%E2%80%9D%20message.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3CLI%3EOccasionally%2C%20both%20scripts%20fail%20to%20get%20a%20lock%20on%20the%20table.%26nbsp%3B%20This%20is%20indicated%20by%20both%20scripts%20making%20500%20attempts%20to%20get%20a%20lock.%26nbsp%3B%20If%20you%20abort%20the%20scripts%2C%20and%20then%20try%20opening%20the%20results%20table%2C%20it%20will%20have%20a%20%3CEM%3Efile_lock%3C%2FEM%3E%20table%20variable.%26nbsp%3B%20Both%20instances%20of%20JMP%20will%20have%20the%20table%20locked.%26nbsp%3B%20The%20only%20way%20to%20unlock%20it%20is%20to%20close%20both%20sessions%20of%20JMP.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E50%20iterations%20is%20usually%20sufficient%20to%20observe%20(1)%20and%20(2)%20but%20occasionally%20you%20need%20to%20increase%20the%20number%20of%20iterations%20to%20see%20(2).%26nbsp%3B%20Scenario%20(3)%20is%20more%20likely%20with%20100s%20of%20iterations%20and%20with%20the%20wait%20on%20line%20100%20removed.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-743739%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20prompt%20a%20%22%20File%20in%20Use%22%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-743739%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIn%20testing%20I'm%20finding%20a%20scenario%20where%20I%20can%20open%20the%20table%20with%20no%20message%20in%20%3CSTRONG%3Esavelog%3C%2FSTRONG%3E%2C%20but%20when%20I%20come%20to%20save%20I%20get%20a%20an%20error%20%22Unable%20to%20get%20End%20of%20File%20marker%22.%26nbsp%3B%20Not%20only%20does%20this%20prevent%20the%20latest%20data%20from%20saving%2C%20but%20the%20entire%20file%20disappears%2C%20and%20all%20data%20is%20lost.%3C%2FP%3E%0A%3CP%3EIn%20the%20test%20environment%20I%20have%202%20scripts%2C%20identical%20except%20one%20script%20updates%20the%201st%20column%20of%20the%20table%20and%20the%202nd%20script%20updates%20the%202nd%20column.%26nbsp%3B%20Each%20script%20attempts%20the%20update%20the%20table%20100%20times.%26nbsp%3B%20If%20the%20open%20reports%20(via%20%3CEM%3Esavelog%3C%2FEM%3E)%20that%20the%20table%20is%20locked%20then%20it%20waits%20and%20re-attempts%20(along%20the%20lines%20of%20my%20original%20script).%20However%2C%20maybe%20once%20or%20twice%26nbsp%3B%20%26nbsp%3Bin%20the%20100%20attempts%20there%20will%20be%20an%20end%20of%20file%20marker%20error.%26nbsp%3B%20This%20might%20occur%20when%20opening%20the%20file%20(with%20the%20%3CEM%3Esavelog%3C%2FEM%3E%20test)%20or%20when%20saving%20the%20results%20(closing%20and%20saving%20on%20the%20assumption%20that%20there%20is%20write%20access).%26nbsp%3B%20I've%20implemented%20a%20similar%20%3CEM%3Esavelog%3C%2FEM%3E%20test%20on%20close%2C%20but%20by%20then%20it%20is%20too%20late%2C%20the%20damage%20is%20done.%3C%2FP%3E%0A%3CP%3EMy%20experience%20of%20this%20error%20is%20that%20if%20you%20get%20it%20when%20trying%20to%20save%20results%20you're%20in%20big%20trouble%20and%20risk%20losing%20the%20table%20entirely.%26nbsp%3B%20So%20I%20try%20and%20focus%20on%20eliminating%20the%20error%20occurring%20in%20the%20first%20instance%20by%20trying%20to%20reliably%20gain%20read-write%20access%20when%20opening%20the%20table.%26nbsp%3B%2099%25%20of%20the%20time%20I%20achieve%20this%2C%20but%20I%20can%20always%20get%20the%20error%20eventually.%26nbsp%3B%20I%20suspect%20what%20happens%20is%20that%20there%20is%20a%20slim%20chance%20that%20both%20scripts%20get%20read-write%20access%20to%20the%20file%20(atleast%2C%20as%20reported%20by%20savelog)%20but%20at%20some%20point%20one%20script%20keeps%20read-write%20access%20and%20the%20other%20script%20gets%20an%20end%20of%20file%20marker%20error%20-%20probably%20when%20the%20other%20script%20has%20made%20an%20update).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749493%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20prompt%20a%20%22%20File%20in%20Use%22%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749493%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESorry%2C%20lost%20track%20of%20this.%20I%20made%20a%20video%20of%20the%20data%20table%20vanishing%20off%20the%20desktop%20and%20sent%20it%20to%20the%20development%20team.%20Thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
RobRobeyns
Level III

How to prompt a " File in Use" message

Hi,

 

I'm currently creating a JMP file which acts as a database. Therefore I would like to prompt a "File in use" message and keep the file locked for editing when someone else already opened the database and is making changes to the file. For example, the same message you get when you open an Excel file on a server location that is already in use by someone else:

 

file in use message.png

 

 

 

 

I think I already found a part of the answer in the following Community post: Multi-User Access 

 

If I'm correct I would still need to figure out how to lock the table if it is opened by another user.

 

Could someone please help with creating such a script?

 

Thanks

 

10 REPLIES 10
Craige_Hales
Super User

Re: How to prompt a " File in Use" message

Sorry, lost track of this. I made a video of the data table vanishing off the desktop and sent it to the development team. Thanks!

Craige