Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to capture Sharing Violation error
Message
From
22/05/1998 11:40:15
 
 
To
17/05/1998 05:22:26
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00099769
Message ID:
00101194
Views:
20
>>I have a single user DOS application which I am now allowing to have a second user with read only rights. Some temporary tables created with sql selects (a cursor won't do since I need to chage some fields) have fixed names and sometimes lead to "sharing violation" errors in Windows 95. Since the goal is not to have to change too much of the code, I need to trap these errors, but don't know how to do it does anybody know how ?
>
>If you're using FPD, you may use Filer to look for "into table", and locate all the places where this happens, then replace real table names with name expressions, or make them cursors and add a line to use the cursors again, when they became read-write. Thus, two approaches, supposing you have a command like
>
>Select .... into table dbfname
>
>In first scenario, this becomes
>
>tempname=sys(3)
>Select ... into table (tempname)
>use (tempname) alias dbfname
>
>In the other scenario
>
>select ... into cursor anyothername
>use (dbf()) again in 0 alias dbfname
>select dbfname
>
>That's all you have to change. Not too much work in both cases; I'd prefer cursors, because they're, by default, created on your temp drive, i.e. not on the server machine (check the config.f* settings on both machines for tmpfiles, sortwork, editwork, progwork), and they're automatically deleted when you close them, keeping the system free of unnecessary files. In cases where the selected data are to be used later, then it'll be tables, of course, but then you must take care that either their names (or location) be different for each user, or use the error routine as described in the rest of this thread.

Dragan,

Thank you very much for your advice, I like it and will do it that way because it lends itself to the way my program is done. Also thanks for the info on 2.5 to VFP conversion. I will get back to you on that one.

Thanks as well to all ohters who gave ideas, both here and at DevCon.

Alex
Previous
Reply
Map
View

Click here to load this message in the networking platform