Hi all,

Just crossed my mind this afternoon: as we all understand, whenever we
put a local view in the form's Data Environment, then vfp would open the
underlying tables as well. I wonder if this has anything to do with
table corruption possibility. I mean; what if the form only open the
local view and not the underlying tables; suppose there is a power
failure in the middle of transaction; would the table corruption
possibility is lower than if the tables are open as well?

(I hope I could convey my question well. Yet, if the question isn't
clear enough, please let me know, I'll try to re-phrase.)

TIA,
Willianto

Re: Using local view exclusively = reducing table corruption possibility??? by Dan

Dan
Fri Apr 16 12:08:40 CDT 2004

The underlying tables will ALWAYS be opened out of necessity. There's no
actual data stored in a view. It's just a SQL Select command. It has to open
the underlying tables to execute the SELECT command.

Dan

Willianto wrote:
> Hi all,
>
> Just crossed my mind this afternoon: as we all understand, whenever we
> put a local view in the form's Data Environment, then vfp would open
> the underlying tables as well. I wonder if this has anything to do
> with table corruption possibility. I mean; what if the form only open
> the local view and not the underlying tables; suppose there is a power
> failure in the middle of transaction; would the table corruption
> possibility is lower than if the tables are open as well?
>
> (I hope I could convey my question well. Yet, if the question isn't
> clear enough, please let me know, I'll try to re-phrase.)
>
> TIA,
> Willianto



Re: Using local view exclusively = reducing table corruption possibility??? by Al

Al
Fri Apr 16 13:00:27 CDT 2004

A very good question.

vfp will always open the underlying tables again when performing a query
This is true even if you also have the tables open. To prove this, open in
the form in buffered
mode, make changes, then your changes will not be reflected if you open
another view
on the same tables. And vfp will close any tables it opened (usually) after
the query

If you issue a tableupdate(), even within a transaction, on a view without
the underlying
tables opened, then vfp will open the tables.
What is NOT clear (we haven't tested) is in what mode they are thus opened.
If they are opend in any but table buffered mode, then the update could
fail and cause corruption.

To avoid this, we always make sure all table are opened by us in table
buffered mode

al

"Willianto" <willianto@remove-me.telkom-and-me.net> wrote in message
news:e0PPEM8IEHA.2908@TK2MSFTNGP09.phx.gbl...
> Hi all,
>
> Just crossed my mind this afternoon: as we all understand, whenever we
> put a local view in the form's Data Environment, then vfp would open the
> underlying tables as well. I wonder if this has anything to do with
> table corruption possibility. I mean; what if the form only open the
> local view and not the underlying tables; suppose there is a power
> failure in the middle of transaction; would the table corruption
> possibility is lower than if the tables are open as well?
>
> (I hope I could convey my question well. Yet, if the question isn't
> clear enough, please let me know, I'll try to re-phrase.)
>
> TIA,
> Willianto
>
>



Re: Using local view exclusively = reducing table corruption possibility??? by Anders

Anders
Fri Apr 16 13:02:14 CDT 2004

With views you only need the underlying table open, and it happens
automatically, when for a brief moment you open, requery or tableupdate. In
between you can close the base tables.
-Anders

"Willianto" <willianto@remove-me.telkom-and-me.net> skrev i meddelandet
news:e0PPEM8IEHA.2908@TK2MSFTNGP09.phx.gbl...
> Hi all,
>
> Just crossed my mind this afternoon: as we all understand, whenever we
> put a local view in the form's Data Environment, then vfp would open the
> underlying tables as well. I wonder if this has anything to do with
> table corruption possibility. I mean; what if the form only open the
> local view and not the underlying tables; suppose there is a power
> failure in the middle of transaction; would the table corruption
> possibility is lower than if the tables are open as well?
>
> (I hope I could convey my question well. Yet, if the question isn't
> clear enough, please let me know, I'll try to re-phrase.)
>
> TIA,
> Willianto
>
>



Re: Using local view exclusively = reducing table corruption possibility??? by Willianto

Willianto
Sat Apr 17 10:26:58 CDT 2004

Hi Dan,

> The underlying tables will ALWAYS be opened out of necessity. There's
no
> actual data stored in a view. It's just a SQL Select command. It has
to open
> the underlying tables to execute the SELECT command.

I'm aware of those fact. That's why I wonder: If I USE the_view and
close the underlying table, hence the table doesn't in the open
state --- at least not until I send REQUERY( ) or TABLEUPDATE( )
(obviously I use buffering), will that reduce the possibility of table
corruption? Say, suppose that there is a power failure while the user
working on that form. Is it true that nothing gonna hurts the table
because the table itself (or themselves) is/are *not* open (as you say:
no actual data in a view).

What do you think?

Willianto



Re: Using local view exclusively = reducing table corruption possibility??? by Willianto

Willianto
Sat Apr 17 10:30:19 CDT 2004

Anders,
> With views you only need the underlying table open, and it happens
> automatically, when for a brief moment you open, requery or
tableupdate. In
> between you can close the base tables.
... and will that reduce the possibility of table corruption *if* any
power failure occurred while editing the form?

It is understandable if the file get corrupt when the power failure
occur while the TABLEUPDATE( ) is running. But, that's only a fraction
of second, isn't it?

Willianto

"Anders" <anders@anders> wrote in message
news:eAClZz9IEHA.2744@TK2MSFTNGP10.phx.gbl...
> -Anders
>
> "Willianto" <willianto@remove-me.telkom-and-me.net> skrev i
meddelandet
> news:e0PPEM8IEHA.2908@TK2MSFTNGP09.phx.gbl...
> > Hi all,
> >
> > Just crossed my mind this afternoon: as we all understand, whenever
we
> > put a local view in the form's Data Environment, then vfp would open
the
> > underlying tables as well. I wonder if this has anything to do with
> > table corruption possibility. I mean; what if the form only open the
> > local view and not the underlying tables; suppose there is a power
> > failure in the middle of transaction; would the table corruption
> > possibility is lower than if the tables are open as well?
> >
> > (I hope I could convey my question well. Yet, if the question isn't
> > clear enough, please let me know, I'll try to re-phrase.)
> >
> > TIA,
> > Willianto
> >
> >
>
>



Re: Using local view exclusively = reducing table corruption possibility??? by Anders

Anders
Sat Apr 17 21:46:27 CDT 2004

Yes, probably. Unless you running hundreds of updates from a buffered table.
But then you wrap that in a VFP transaction.
-Anders

"Willianto" <willianto@remove-me.telkom-and-me.net> skrev i meddelandet
news:OSsUo5IJEHA.1740@tk2msftngp13.phx.gbl...
> Anders,
> > With views you only need the underlying table open, and it happens
> > automatically, when for a brief moment you open, requery or
> tableupdate. In
> > between you can close the base tables.
> ... and will that reduce the possibility of table corruption *if* any
> power failure occurred while editing the form?
>
> It is understandable if the file get corrupt when the power failure
> occur while the TABLEUPDATE( ) is running. But, that's only a fraction
> of second, isn't it?
>
> Willianto
>
> "Anders" <anders@anders> wrote in message
> news:eAClZz9IEHA.2744@TK2MSFTNGP10.phx.gbl...
> > -Anders
> >
> > "Willianto" <willianto@remove-me.telkom-and-me.net> skrev i
> meddelandet
> > news:e0PPEM8IEHA.2908@TK2MSFTNGP09.phx.gbl...
> > > Hi all,
> > >
> > > Just crossed my mind this afternoon: as we all understand, whenever
> we
> > > put a local view in the form's Data Environment, then vfp would open
> the
> > > underlying tables as well. I wonder if this has anything to do with
> > > table corruption possibility. I mean; what if the form only open the
> > > local view and not the underlying tables; suppose there is a power
> > > failure in the middle of transaction; would the table corruption
> > > possibility is lower than if the tables are open as well?
> > >
> > > (I hope I could convey my question well. Yet, if the question isn't
> > > clear enough, please let me know, I'll try to re-phrase.)
> > >
> > > TIA,
> > > Willianto
> > >
> > >
> >
> >
>
>



Re: Using local view exclusively = reducing table corruption possibility??? by Andrew

Andrew
Mon Apr 19 02:56:18 CDT 2004

Willianto wrote:
> Hi all,
>
> Just crossed my mind this afternoon: as we all understand, whenever we
> put a local view in the form's Data Environment, then vfp would open
> the underlying tables as well. I wonder if this has anything to do
> with table corruption possibility. I mean; what if the form only open
> the local view and not the underlying tables; suppose there is a power
> failure in the middle of transaction; would the table corruption
> possibility is lower than if the tables are open as well?
>
> (I hope I could convey my question well. Yet, if the question isn't
> clear enough, please let me know, I'll try to re-phrase.)


I'm not sure how relevant this is but I had a number of corruption problems
with a table that was held open all day on 5 workstations that take quite a
bit of "power abuse". This is a FPW2.6 system which is where my scenario
differs. These machines are used for scanning orders and advancing
production status; I was fairly often having to recreate indexes but I
rewrote the program to USE the table when the orders are scanned; REPLACE
the status and then USE the table to close it again. So the application is
still always open but the tables are only when they need to be. I hardly
ever have index corruption in the table now.

--
Regards
Andrew Howell



Re: Using local view exclusively = reducing table corruption possibility??? by Dan

Dan
Mon Apr 19 12:04:56 CDT 2004

Sorry. I have no experience here. But I'd expect nothing but trouble to come
from interfering with when Fox wants DBF's opened.

Dan

Willianto wrote:
> Hi Dan,
>
>> The underlying tables will ALWAYS be opened out of necessity.
>> There's no actual data stored in a view. It's just a SQL Select
>> command. It has to open the underlying tables to execute the SELECT
>> command.
>
> I'm aware of those fact. That's why I wonder: If I USE the_view and
> close the underlying table, hence the table doesn't in the open
> state --- at least not until I send REQUERY( ) or TABLEUPDATE( )
> (obviously I use buffering), will that reduce the possibility of table
> corruption? Say, suppose that there is a power failure while the user
> working on that form. Is it true that nothing gonna hurts the table
> because the table itself (or themselves) is/are *not* open (as you
> say: no actual data in a view).
>
> What do you think?
>
> Willianto