Home > Archive > FoxPro database connector > April 2005 > Command to determine if data hasn't been updated to the table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Command to determine if data hasn't been updated to the table
Doug Allan

2005-04-07, 8:05 pm

I'm trying to find a command in VFP6 to do this but i'm sure if one exists.
I hope somebody can help me out.

Is there a command that tells me if there's any data in a table buffer that
hasn't been written to the table with the TABLEUPDATE() command? I want to
be able to ask the user if he wants to save the data when he hits the Close
button but only if there's been data that's been changed and not saved to
the table.

Thanks for your help.

Doug


Paul D

2005-04-07, 8:05 pm

OLDVAL() Returns original field values for fields that have been modified
but not updated.


"Doug Allan" <doug-allan@home.com> wrote in message
news:cBM_d.719603$6l.538283@pd7tw2no...
> I'm trying to find a command in VFP6 to do this but i'm sure if one

exists.
> I hope somebody can help me out.
>
> Is there a command that tells me if there's any data in a table buffer

that
> hasn't been written to the table with the TABLEUPDATE() command? I want to
> be able to ask the user if he wants to save the data when he hits the

Close

> button but only if there's been data that's been changed and not saved to
> the table.
>
> Thanks for your help.
>
> Doug
>
>



Jürgen Wondzinski

2005-04-07, 8:05 pm

Hi Doug,

put this code into the QueryUnload Event:

IF "2" $ GETFLDSTATE(-1) or "4" $ GETFLDSTATE(-1)
nAnswer = MESSAGEBOX("Do you want to save your changes and close the
Application?", 3+32,"Question")
DO CASE
CASE nAnswer = 6
TABLEUPDATE()
CASE nAnswer = 7
TABELREVERT()
OTHERWISE
NODEFAULT && Don't proceed with shut down
ENDCASE
ENDIF


Now, if you close your form with the "X" button, your user will
automatically gets askes. You surely will be able to adopt that to your
regular close button...

--

Servus

wOOdy

|\_/| ------ ProLib - programmers liberty -------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de and www.AFPages.com
-------------------------------------------------


Doug Allan

2005-04-07, 8:05 pm

Thanks for your help. That's exactly what I was looking for.

Doug


"Jürgen Wondzinski" <woody@prolib.de> wrote in message
news:egpZ85KLFHA.3184@TK2MSFTNGP09.phx.gbl...
> Hi Doug,
>
> put this code into the QueryUnload Event:
>
> IF "2" $ GETFLDSTATE(-1) or "4" $ GETFLDSTATE(-1)
> nAnswer = MESSAGEBOX("Do you want to save your changes and close the
> Application?", 3+32,"Question")
> DO CASE
> CASE nAnswer = 6
> TABLEUPDATE()
> CASE nAnswer = 7
> TABELREVERT()
> OTHERWISE
> NODEFAULT && Don't proceed with shut down
> ENDCASE
> ENDIF
>
>
> Now, if you close your form with the "X" button, your user will
> automatically gets askes. You surely will be able to adopt that to your
> regular close button...
>
> --
>
> Servus
>
> wOOdy
>
> |\_/| ------ ProLib - programmers liberty -------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de and www.AFPages.com
> -------------------------------------------------
>
>



Doug Allan

2005-04-07, 8:05 pm

Thanks for your help.

Doug


"Paul D" <JustMe@Somewhere.net> wrote in message
news:OS6iP7GLFHA.3552@TK2MSFTNGP12.phx.gbl...
> OLDVAL() Returns original field values for fields that have been modified
> but not updated.
>
>
> "Doug Allan" <doug-allan@home.com> wrote in message
> news:cBM_d.719603$6l.538283@pd7tw2no...
> exists.
> that
to[color=darkred]
> Close
to[color=darkred]
>
>



Ian Simcock

2005-04-07, 8:05 pm

Hi Doug.

What you need to do depends on whether you have Row or Table buffering
Enabled.
For Row Buffering -
llUnsavedData = "2" $ GetFldState(-1) or "4" $ GetFldState(-1)

For Table Buffering -
llUnsavedData = (GetNextModified(0) # 0)

Hope that helps.

Ian Simcock.


"Doug Allan" <doug-allan@home.com> wrote in message
news:cBM_d.719603$6l.538283@pd7tw2no...
> I'm trying to find a command in VFP6 to do this but i'm sure if one

exists.
> I hope somebody can help me out.
>
> Is there a command that tells me if there's any data in a table buffer

that
> hasn't been written to the table with the TABLEUPDATE() command? I want to
> be able to ask the user if he wants to save the data when he hits the

Close

> button but only if there's been data that's been changed and not saved to
> the table.
>
> Thanks for your help.
>
> Doug
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com