Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 How to detect a table in use by views
Message
From
05/10/2004 07:20:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00948339
Message ID:
00948752
Views:
20
>Hi Cetin
>
>>-Get a list of tables that need to be used exclusively in a chain operation (ie: delete and pack records from a table. This should in turn affect a series of child tables either by removing -deleting- or orphaning them. What RI does in its simple form but my own RI implementation.)
>
>Okay, done
>
>>-Should the operation fail or continue if anyone of them cannot be used exclusively
>
>In this situation dele pack as and when available, but yes in serious apps there could be a situation where all the required tables are to be exclusive before proceeding.
>
>>-To try to take them into exclusive mode check sessions they're used and take action as appropriate
>
>You mean all together at the very begining, no matter how long the actual process takes, then here it is okay but serious apps yes.
>
>>-Backup
>
>What? <g> With my experience of providing backup routines in the app, the users end up troubling us more for third party utilities then for the app itself <g>. But yes I have warned the user on the form in red.
>
>>-Loop the tables to operate on and do whatever
>
>Okay
>
>>-Inform the user of the steps you're performing
>
>Anything simple, I generally use WAIT WINDOWS NOWAITs
>
>>Well even outlining was not easy at the moment:)
>
>Looks complete to me nevertheless. Thanks.
>
>>I'd instead make it simple:
>>
>>
on error llHadError = .t.
>>use myTable exclusive in 0
>>on error
>>if m.llHadError
>> aerror(arrErr)
>> ? 'Error',arrErr,message(),message(1)
>>else
>> * do whatever
>>endif
>
>We can maybe have a ExclOpenTble() function borrowing and expanding the name from Nadya's function. Or maybe put in a shortcircuit logic in Nadya's function when EXCLUSIVE is specified.

How you prefer:) I tend to use USE < g > directly.
Use myTable Exclusive
in one shot takes care of it's naming, being in use with any alias in any session etc.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform