I use a view to fill a grid.

To add an additional row in the grid I provide a button on the form which
adds a row in the view, enters some predefiened data and send an update to
the view with:

=TABLEUPDATE(1,.t.,'view')

and put the focus onto the grid.

After entering data, closing the form, reopening it again the predefined
data are there but the manually entered data are lost!

In the grid in every text and combo box I put in the Valid Methods the code:
=TABLEUPDATE(1,.t.,'view')

The problem occurs only if a new row is added to the grid/view.

Please could someone give me an advice how to avoid the data loss.

Wolfgang

Re: Update Views problem by Dan

Dan
Tue Aug 08 15:57:16 CDT 2006

Sounds like you didn't check "Send SQL Updates" in the view designer.

Dan

Max wrote:
> I use a view to fill a grid.
>
> To add an additional row in the grid I provide a button on the form
> which adds a row in the view, enters some predefiened data and send
> an update to the view with:
>
> =TABLEUPDATE(1,.t.,'view')
>
> and put the focus onto the grid.
>
> After entering data, closing the form, reopening it again the
> predefined data are there but the manually entered data are lost!
>
> In the grid in every text and combo box I put in the Valid Methods
> the code: =TABLEUPDATE(1,.t.,'view')
>
> The problem occurs only if a new row is added to the grid/view.
>
> Please could someone give me an advice how to avoid the data loss.
>
> Wolfgang



Re: Update Views problem by Max

Max
Tue Aug 08 23:04:10 CDT 2006

Thanks Dan.
If it would be that simple it would be great. Half the data are there and
the other half not?

I can open the form and enter data as much as I like, the data are NOT lost,
everything is there. Only if I use my "Add new Row" button for adding a new
row the entered data are getting lost.

If I add a row - close and reopen the form data can be entered without loss.
If data are entered directly after a row has been added, all the entered
data are lost.

At the moment I told my users to add a row, close the form, reopen it and
then enter data. It works but it cannot be that there is no solution for
this problem, is'nt it???

Wolfgang


"Dan Freeman" <spam@microsoft.com> wrote in message
news:eVJo80yuGHA.1256@TK2MSFTNGP02.phx.gbl...
> Sounds like you didn't check "Send SQL Updates" in the view designer.
>
> Dan
>
> Max wrote:
>> I use a view to fill a grid.
>>
>> To add an additional row in the grid I provide a button on the form
>> which adds a row in the view, enters some predefiened data and send
>> an update to the view with:
>>
>> =TABLEUPDATE(1,.t.,'view')
>>
>> and put the focus onto the grid.
>>
>> After entering data, closing the form, reopening it again the
>> predefined data are there but the manually entered data are lost!
>>
>> In the grid in every text and combo box I put in the Valid Methods
>> the code: =TABLEUPDATE(1,.t.,'view')
>>
>> The problem occurs only if a new row is added to the grid/view.
>>
>> Please could someone give me an advice how to avoid the data loss.
>>
>> Wolfgang
>
>



Re: Update Views problem by Bernhard

Bernhard
Wed Aug 09 03:27:58 CDT 2006

Hi Max,

> Thanks Dan.
> If it would be that simple it would be great. Half the data are there and
> the other half not?
>
> I can open the form and enter data as much as I like, the data are NOT lost,
> everything is there. Only if I use my "Add new Row" button for adding a new
> row the entered data are getting lost.
>
> If I add a row - close and reopen the form data can be entered without loss.
> If data are entered directly after a row has been added, all the entered
> data are lost.

Maybe you put some additional TABLEUPDATE into the form close event sequence
before the view gets closed.

Regards
Bernhard Sander

Re: Update Views problem by Jean-Claude

Jean-Claude
Wed Aug 09 03:54:01 CDT 2006

Hi,

Are you sure that there is no event that clear the controlsources of the
columns of the grid ?

JCR

"Max" <max@lox.com> a écrit dans le message de news:
u5$$mj2uGHA.4876@TK2MSFTNGP04.phx.gbl...
> Thanks Dan.
> If it would be that simple it would be great. Half the data are there and
> the other half not?
>
> I can open the form and enter data as much as I like, the data are NOT
> lost, everything is there. Only if I use my "Add new Row" button for
> adding a new row the entered data are getting lost.
>
> If I add a row - close and reopen the form data can be entered without
> loss. If data are entered directly after a row has been added, all the
> entered data are lost.
>
> At the moment I told my users to add a row, close the form, reopen it and
> then enter data. It works but it cannot be that there is no solution for
> this problem, is'nt it???
>
> Wolfgang
>
>
> "Dan Freeman" <spam@microsoft.com> wrote in message
> news:eVJo80yuGHA.1256@TK2MSFTNGP02.phx.gbl...
>> Sounds like you didn't check "Send SQL Updates" in the view designer.
>>
>> Dan
>>
>> Max wrote:
>>> I use a view to fill a grid.
>>>
>>> To add an additional row in the grid I provide a button on the form
>>> which adds a row in the view, enters some predefiened data and send
>>> an update to the view with:
>>>
>>> =TABLEUPDATE(1,.t.,'view')
>>>
>>> and put the focus onto the grid.
>>>
>>> After entering data, closing the form, reopening it again the
>>> predefined data are there but the manually entered data are lost!
>>>
>>> In the grid in every text and combo box I put in the Valid Methods
>>> the code: =TABLEUPDATE(1,.t.,'view')
>>>
>>> The problem occurs only if a new row is added to the grid/view.
>>>
>>> Please could someone give me an advice how to avoid the data loss.
>>>
>>> Wolfgang
>>
>>
>
>



Re: Update Views problem by Max

Max
Wed Aug 09 11:21:58 CDT 2006

This is a multi-part message in MIME format.

------=_NextPart_000_000F_01C6BC0A.9C27B2A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi JCR,

>=20
> Are you sure that there is no event that clear the controlsources of =
the=20
> columns of the grid ?
>=20
Yes, I am sure, no code to clear the record source. The form works fine, =
only if a row is added the problem occurs. Here is the code in the click =
event of the button to add a row:

SELECT vwballast=20
GO BOTTOM=20
SCATTER FIELDS date, port, voy, start, stop, tank, in_out, watch MEMVAR
APPEND BLANK=20
REPLACE vwballast.date WITH DATE(), vwballast.port WITH m.port, ;
vwballast.voy WITH m.voy, vwballast.watch WITH m.watch=20
=3DTABLEUPDATE(1,.t.,'vwballast')=20
this.Parent.pageframe1.page1.grdBallast.SetFocus

Thats it. Only after this code the data entered in the grid are lost, =
the TABLEUPDATE does not work. I checked with the debugger, TABLEUPDATE =
reports success in each text/combo box, but the data are not updated.

I did change the APPEND BLANK with INSERT SQL, but no success.

thanks
Max



> "Max" <max@lox.com> a =E9crit dans le message de news:=20
> u5$$mj2uGHA.4876@TK2MSFTNGP04.phx.gbl...
>> Thanks Dan.
>> If it would be that simple it would be great. Half the data are there =
and=20
>> the other half not?
>>
>> I can open the form and enter data as much as I like, the data are =
NOT=20
>> lost, everything is there. Only if I use my "Add new Row" button for=20
>> adding a new row the entered data are getting lost.
>>
>> If I add a row - close and reopen the form data can be entered =
without=20
>> loss. If data are entered directly after a row has been added, all =
the=20
>> entered data are lost.
>>
>> At the moment I told my users to add a row, close the form, reopen it =
and=20
>> then enter data. It works but it cannot be that there is no solution =
for=20
>> this problem, is'nt it???
>>
>> Wolfgang
>>
>>
>> "Dan Freeman" <spam@microsoft.com> wrote in message=20
>> news:eVJo80yuGHA.1256@TK2MSFTNGP02.phx.gbl...
>>> Sounds like you didn't check "Send SQL Updates" in the view =
designer.
>>>
>>> Dan
>>>
>>> Max wrote:
>>>> I use a view to fill a grid.
>>>>
>>>> To add an additional row in the grid I provide a button on the form
>>>> which adds a row in the view, enters some predefiened data and send
>>>> an update to the view with:
>>>>
>>>> =3DTABLEUPDATE(1,.t.,'view')
>>>>
>>>> and put the focus onto the grid.
>>>>
>>>> After entering data, closing the form, reopening it again the
>>>> predefined data are there but the manually entered data are lost!
>>>>
>>>> In the grid in every text and combo box I put in the Valid Methods
>>>> the code: =3DTABLEUPDATE(1,.t.,'view')
>>>>
>>>> The problem occurs only if a new row is added to the grid/view.
>>>>
>>>> Please could someone give me an advice how to avoid the data loss.
>>>>
>>>> Wolfgang
>>>
>>>
>>
>>=20
>=20
>
------=_NextPart_000_000F_01C6BC0A.9C27B2A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2912" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>Hi JCR,</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&gt; <BR>&gt; Are you sure that there is no event that clear the=20
controlsources of the <BR>&gt; columns of the grid ?<BR>&gt; <BR>Yes, I =
am sure,=20
no code to clear the record source. The form works fine, only if a row =
is added=20
the problem occurs. Here is the code in the click event of the button to =
add a=20
row:</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>SELECT =
</FONT><FONT=20
face=3D"Courier New" size=3D2>vwballast </FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>GO BOTTOM =
</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>SCATTER FIELDS=20
date</FONT><FONT face=3D"Courier New" size=3D2>, port, voy, start, stop, =
tank,=20
in_out, watch </FONT><FONT face=3D"Courier New" color=3D#0000ff=20
size=3D2>MEMVAR</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#008000 size=3D2>APPEND=20
BLANK&nbsp;</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#008000 size=3D2>REPLACE =
vwballast.date WITH=20
DATE(), </FONT><FONT face=3D"Courier New" color=3D#008000 =
size=3D2>vwballast.port WITH=20
m.port, ;</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#008000 size=3D2>vwballast.voy =
WITH m.voy,=20
</FONT><FONT face=3D"Courier New" color=3D#008000 =
size=3D2>vwballast.watch WITH=20
m.watch </FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>=3D</FONT><FONT face=3D"Courier =
New"=20
color=3D#0000ff size=3D2>TABLEUPDATE</FONT><FONT face=3D"Courier New"=20
size=3D2>(1,.t.,'vwballast') </FONT><FONT face=3D"Courier New" =
color=3D#0000ff=20
size=3D2></FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>this</FONT><FONT=20
face=3D"Courier New" size=3D2>.</FONT><FONT face=3D"Courier New" =
color=3D#0000ff=20
size=3D2>Parent</FONT><FONT face=3D"Courier New"=20
size=3D2>.pageframe1.page1.grdBallast.</FONT><FONT face=3D"Courier New"=20
color=3D#0000ff size=3D2>SetFocus</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>Thats it. Only =
after this=20
code the data entered in the grid are lost,&nbsp;the TABLEUPDATE does =
not work.=20
I checked with the debugger, TABLEUPDATE reports success in each =
text/combo box,=20
but the data are not updated.</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>I did change =
the APPEND BLANK=20
with INSERT SQL, but no success.</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>thanks</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>Max</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&gt; "Max" &lt;<A href=3D"mailto:max@lox.com">max@lox.com</A>&gt; a =
=E9crit=20
dans le message de news: <BR>&gt; <A=20
href=3D"mailto:u5$$mj2uGHA.4876@TK2MSFTNGP04.phx.gbl">u5$$mj2uGHA.4876@TK=
2MSFTNGP04.phx.gbl</A>...<BR>&gt;&gt;=20
Thanks Dan.<BR>&gt;&gt; If it would be that simple it would be great. =
Half the=20
data are there and <BR>&gt;&gt; the other half =
not?<BR>&gt;&gt;<BR>&gt;&gt; I=20
can open the form and enter data as much as I like, the data are NOT=20
<BR>&gt;&gt; lost, everything is there. Only if I use my "Add new Row" =
button=20
for <BR>&gt;&gt; adding a new row the entered data are getting=20
lost.<BR>&gt;&gt;<BR>&gt;&gt; If I add a row - close and reopen the form =
data=20
can be entered without <BR>&gt;&gt; loss. If data are entered directly =
after a=20
row has been added, all the <BR>&gt;&gt; entered data are=20
lost.<BR>&gt;&gt;<BR>&gt;&gt; At the moment I told my users to add a =
row, close=20
the form, reopen it and <BR>&gt;&gt; then enter data. It works but it =
cannot be=20
that there is no solution for <BR>&gt;&gt; this problem, is'nt=20
it???<BR>&gt;&gt;<BR>&gt;&gt; =
Wolfgang<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; "Dan=20
Freeman" &lt;<A =
href=3D"mailto:spam@microsoft.com">spam@microsoft.com</A>&gt;=20
wrote in message <BR>&gt;&gt; <A=20
href=3D"news:eVJo80yuGHA.1256@TK2MSFTNGP02.phx.gbl">news:eVJo80yuGHA.1256=
@TK2MSFTNGP02.phx.gbl</A>...<BR>&gt;&gt;&gt;=20
Sounds like you didn't check "Send SQL Updates" in the view=20
designer.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; =
Dan<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;=20
Max wrote:<BR>&gt;&gt;&gt;&gt; I use a view to fill a=20
grid.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; To add an additional row =
in the=20
grid I provide a button on the form<BR>&gt;&gt;&gt;&gt; which adds a row =
in the=20
view, enters some predefiened data and send<BR>&gt;&gt;&gt;&gt; an =
update to the=20
view with:<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;=20
=3DTABLEUPDATE(1,.t.,'view')<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; and =
put the=20
focus onto the grid.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; After =
entering=20
data, closing the form, reopening it again the<BR>&gt;&gt;&gt;&gt; =
predefined=20
data are there but the manually entered data are=20
lost!<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; In the grid in every text =
and=20
combo box I put in the Valid Methods<BR>&gt;&gt;&gt;&gt; the code:=20
=3DTABLEUPDATE(1,.t.,'view')<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; The =
problem=20
occurs only if a new row is added to the=20
grid/view.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; Please could someone =
give me=20
an advice how to avoid the data =
loss.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;=20
Wolfgang<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; =
<BR>&gt;=20
<BR>&gt;</DIV></BODY></HTML>

------=_NextPart_000_000F_01C6BC0A.9C27B2A0--


Re: Update Views problem by Max

Max
Wed Aug 09 11:31:28 CDT 2006

Hi Bernhard,
>
> Maybe you put some additional TABLEUPDATE into the form close event
> sequence before the view gets closed.
>
One thing I learned fast that with views you have to put TABLEUPDATES all
over the place.
I have TABLEUPDATE in the grid in each and every column, literally after
every data entry. I put as you suggest some more additional TABLEUPDATE into
the grid valid, the form destroy, the click event of the form close button
without any success.

Thanks
Max


>
>> Thanks Dan.
>> If it would be that simple it would be great. Half the data are there and
>> the other half not?
>>
>> I can open the form and enter data as much as I like, the data are NOT
>> lost, everything is there. Only if I use my "Add new Row" button for
>> adding a new row the entered data are getting lost.
>>
>> If I add a row - close and reopen the form data can be entered without
>> loss. If data are entered directly after a row has been added, all the
>> entered data are lost.
>
> Maybe you put some additional TABLEUPDATE into the form close event
> sequence before the view gets closed.
>
> Regards
> Bernhard Sander



Re: Update Views problem by jclriv

jclriv
Thu Aug 10 02:45:13 CDT 2006

This is a multi-part message in MIME format.

------=_NextPart_000_0014_01C6BC61.AD6C8DE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

First, I think you have a lot of tests to find where the problem is...
Here are some few ideas that come to me, hope they will give you =
others...
Is the view a parameterized one ? Try to put a requery() after the =
tableupdate, just to see if the data you inserted keeps corresponding to =
the parameter.
If you always save the datas, try to set buffermode of the view to 3 =
(assuming it's currently 5).
Perhaps you should try to create a table with the same name and =
structure that the view, and test with this table in the correct =
buffermode. If the problem still occurs, perhaps it doesn't come from =
the view.
If your view is a local one, isn't the original table bufferized ? (all =
tableupdates of the view work, but the table would never be saved)
Hope this helps,
keep courage,
JC
"Max" <max@lox.com> a =E9crit dans le message de news: =
OeUI6$8uGHA.5044@TK2MSFTNGP05.phx.gbl...
Hi JCR,

>=20
> Are you sure that there is no event that clear the controlsources of =
the=20
> columns of the grid ?
>=20
Yes, I am sure, no code to clear the record source. The form works =
fine, only if a row is added the problem occurs. Here is the code in the =
click event of the button to add a row:

SELECT vwballast=20
GO BOTTOM=20
SCATTER FIELDS date, port, voy, start, stop, tank, in_out, watch =
MEMVAR
APPEND BLANK=20
REPLACE vwballast.date WITH DATE(), vwballast.port WITH m.port, ;
vwballast.voy WITH m.voy, vwballast.watch WITH m.watch=20
=3DTABLEUPDATE(1,.t.,'vwballast')=20
this.Parent.pageframe1.page1.grdBallast.SetFocus

Thats it. Only after this code the data entered in the grid are lost, =
the TABLEUPDATE does not work. I checked with the debugger, TABLEUPDATE =
reports success in each text/combo box, but the data are not updated.

I did change the APPEND BLANK with INSERT SQL, but no success.

thanks
Max



> "Max" <max@lox.com> a =E9crit dans le message de news:=20
> u5$$mj2uGHA.4876@TK2MSFTNGP04.phx.gbl...
>> Thanks Dan.
>> If it would be that simple it would be great. Half the data are =
there and=20
>> the other half not?
>>
>> I can open the form and enter data as much as I like, the data are =
NOT=20
>> lost, everything is there. Only if I use my "Add new Row" button =
for=20
>> adding a new row the entered data are getting lost.
>>
>> If I add a row - close and reopen the form data can be entered =
without=20
>> loss. If data are entered directly after a row has been added, all =
the=20
>> entered data are lost.
>>
>> At the moment I told my users to add a row, close the form, reopen =
it and=20
>> then enter data. It works but it cannot be that there is no =
solution for=20
>> this problem, is'nt it???
>>
>> Wolfgang
>>
>>
>> "Dan Freeman" <spam@microsoft.com> wrote in message=20
>> news:eVJo80yuGHA.1256@TK2MSFTNGP02.phx.gbl...
>>> Sounds like you didn't check "Send SQL Updates" in the view =
designer.
>>>
>>> Dan
>>>
>>> Max wrote:
>>>> I use a view to fill a grid.
>>>>
>>>> To add an additional row in the grid I provide a button on the =
form
>>>> which adds a row in the view, enters some predefiened data and =
send
>>>> an update to the view with:
>>>>
>>>> =3DTABLEUPDATE(1,.t.,'view')
>>>>
>>>> and put the focus onto the grid.
>>>>
>>>> After entering data, closing the form, reopening it again the
>>>> predefined data are there but the manually entered data are lost!
>>>>
>>>> In the grid in every text and combo box I put in the Valid =
Methods
>>>> the code: =3DTABLEUPDATE(1,.t.,'view')
>>>>
>>>> The problem occurs only if a new row is added to the grid/view.
>>>>
>>>> Please could someone give me an advice how to avoid the data =
loss.
>>>>
>>>> Wolfgang
>>>
>>>
>>
>>=20
>=20
>
------=_NextPart_000_0014_01C6BC61.AD6C8DE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2912" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>First, I think you have a lot of tests =
to find=20
where the problem is...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Here are some few ideas that come to =
me, hope they=20
will give you others...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>Is the view a&nbsp;</FONT><FONT =
face=3DArial=20
size=3D2>parameterized one ? Try to put a requery() after the =
tableupdate, just to=20
see if the data you inserted keeps corresponding to the =
parameter.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>If you always save the datas, try to =
set buffermode=20
of the view to 3 (assuming it's currently 5).</FONT></DIV>Perhaps you =
should try=20
to create a table with the same name and structure that the view, and =
test with=20
this table in the correct buffermode. If the problem still occurs, =
perhaps it=20
doesn't come from the view.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>If your view is a local one, isn't the =
original=20
table&nbsp;bufferized ? (all tableupdates of the view work, but the =
table would=20
never be saved)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Hope this helps,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>keep courage,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>JC</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Max" &lt;<A href=3D"mailto:max@lox.com">max@lox.com</A>&gt; a =
=E9crit dans=20
le message de news: <A=20
=
href=3D"mailto:OeUI6$8uGHA.5044@TK2MSFTNGP05.phx.gbl">OeUI6$8uGHA.5044@TK=
2MSFTNGP05.phx.gbl</A>...</DIV>
<DIV>Hi JCR,</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&gt; <BR>&gt; Are you sure that there is no event that clear the=20
controlsources of the <BR>&gt; columns of the grid ?<BR>&gt; <BR>Yes, =
I am=20
sure, no code to clear the record source. The form works fine, only if =
a row=20
is added the problem occurs. Here is the code in the click event of =
the button=20
to add a row:</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>SELECT =
</FONT><FONT=20
face=3D"Courier New" size=3D2>vwballast </FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>GO BOTTOM =
</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>SCATTER =
FIELDS=20
date</FONT><FONT face=3D"Courier New" size=3D2>, port, voy, start, =
stop, tank,=20
in_out, watch </FONT><FONT face=3D"Courier New" color=3D#0000ff=20
size=3D2>MEMVAR</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#008000 size=3D2>APPEND=20
BLANK&nbsp;</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#008000 size=3D2>REPLACE =
vwballast.date WITH=20
DATE(), </FONT><FONT face=3D"Courier New" color=3D#008000 =
size=3D2>vwballast.port=20
WITH m.port, ;</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#008000 size=3D2>vwballast.voy =
WITH m.voy,=20
</FONT><FONT face=3D"Courier New" color=3D#008000 =
size=3D2>vwballast.watch WITH=20
m.watch </FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>=3D</FONT><FONT =
face=3D"Courier New"=20
color=3D#0000ff size=3D2>TABLEUPDATE</FONT><FONT face=3D"Courier New"=20
size=3D2>(1,.t.,'vwballast') </FONT><FONT face=3D"Courier New" =
color=3D#0000ff=20
size=3D2></FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>this</FONT><FONT=20
face=3D"Courier New" size=3D2>.</FONT><FONT face=3D"Courier New" =
color=3D#0000ff=20
size=3D2>Parent</FONT><FONT face=3D"Courier New"=20
size=3D2>.pageframe1.page1.grdBallast.</FONT><FONT face=3D"Courier =
New"=20
color=3D#0000ff size=3D2>SetFocus</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>Thats it. =
Only after this=20
code the data entered in the grid are lost,&nbsp;the TABLEUPDATE does =
not=20
work. I checked with the debugger, TABLEUPDATE reports success in each =

text/combo box, but the data are not updated.</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>I did change =
the APPEND=20
BLANK with INSERT SQL, but no success.</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>thanks</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>Max</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&gt; "Max" &lt;<A href=3D"mailto:max@lox.com">max@lox.com</A>&gt; =
a =E9crit=20
dans le message de news: <BR>&gt; <A=20
=
href=3D"mailto:u5$$mj2uGHA.4876@TK2MSFTNGP04.phx.gbl">u5$$mj2uGHA.4876@TK=
2MSFTNGP04.phx.gbl</A>...<BR>&gt;&gt;=20
Thanks Dan.<BR>&gt;&gt; If it would be that simple it would be great. =
Half the=20
data are there and <BR>&gt;&gt; the other half =
not?<BR>&gt;&gt;<BR>&gt;&gt; I=20
can open the form and enter data as much as I like, the data are NOT=20
<BR>&gt;&gt; lost, everything is there. Only if I use my "Add new Row" =
button=20
for <BR>&gt;&gt; adding a new row the entered data are getting=20
lost.<BR>&gt;&gt;<BR>&gt;&gt; If I add a row - close and reopen the =
form data=20
can be entered without <BR>&gt;&gt; loss. If data are entered directly =
after a=20
row has been added, all the <BR>&gt;&gt; entered data are=20
lost.<BR>&gt;&gt;<BR>&gt;&gt; At the moment I told my users to add a =
row,=20
close the form, reopen it and <BR>&gt;&gt; then enter data. It works =
but it=20
cannot be that there is no solution for <BR>&gt;&gt; this problem, =
is'nt=20
it???<BR>&gt;&gt;<BR>&gt;&gt; =
Wolfgang<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt;=20
"Dan Freeman" &lt;<A=20
href=3D"mailto:spam@microsoft.com">spam@microsoft.com</A>&gt; wrote in =
message=20
<BR>&gt;&gt; <A=20
=
href=3D"news:eVJo80yuGHA.1256@TK2MSFTNGP02.phx.gbl">news:eVJo80yuGHA.1256=
@TK2MSFTNGP02.phx.gbl</A>...<BR>&gt;&gt;&gt;=20
Sounds like you didn't check "Send SQL Updates" in the view=20
designer.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; =
Dan<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;=20
Max wrote:<BR>&gt;&gt;&gt;&gt; I use a view to fill a=20
grid.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; To add an additional row =
in the=20
grid I provide a button on the form<BR>&gt;&gt;&gt;&gt; which adds a =
row in=20
the view, enters some predefiened data and send<BR>&gt;&gt;&gt;&gt; an =
update=20
to the view with:<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;=20
=3DTABLEUPDATE(1,.t.,'view')<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; =
and put the=20
focus onto the grid.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; After =
entering=20
data, closing the form, reopening it again the<BR>&gt;&gt;&gt;&gt; =
predefined=20
data are there but the manually entered data are=20
lost!<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; In the grid in every =
text and=20
combo box I put in the Valid Methods<BR>&gt;&gt;&gt;&gt; the code:=20
=3DTABLEUPDATE(1,.t.,'view')<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; =
The problem=20
occurs only if a new row is added to the=20
grid/view.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; Please could =
someone give=20
me an advice how to avoid the data=20
loss.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;=20
Wolfgang<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; =
<BR>&gt;=20
<BR>&gt;</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0014_01C6BC61.AD6C8DE0--


Re: Update Views problem by Bernhard

Bernhard
Thu Aug 10 04:39:23 CDT 2006

Hi Max,

> One thing I learned fast that with views you have to put TABLEUPDATES all
> over the place.
> I have TABLEUPDATE in the grid in each and every column, literally after
> every data entry. I put as you suggest some more additional TABLEUPDATE into
> the grid valid, the form destroy, the click event of the form close button
> without any success.
in your source code examples you never check the return value of TableUpdate.
You should do this. If it is .F. then use AError() to get the reasons.

Regards
Bernhard Sander

Re: Update Views problem by Max

Max
Sun Aug 13 10:32:40 CDT 2006

This is a multi-part message in MIME format.

------=_NextPart_000_000E_01C6BF28.629E5AE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Jean-Claude,
many thanks for you input.
I think I found the problem. It is the TABLEUPDATE.=20
After appending a record and issueing the TABLEUPDATE it seems the view =
is closing all doors. No more data can be updated. Only after closing =
the form (the view is also closed) and reopening the form date can be =
updated.

I had to remove all the TABLEUPDATE in every column and I am back with =
only one TABLEUPDATE when leaving the grid. At the moment it seems to =
work.

The funny thing is, the TABLEUPDATE is working fine in every clolumn as =
long as I do not add a record. When adding a record and sending a =
TABLEUPDATE the view is closed for any further data input.
That looks to me more like a BUG in VFP 9.0

Thanks
Max


"Jean-Claude Rivi=E8re" <jclriv@libreenanglais.fr> wrote in message =
news:eIvHrDFvGHA.4972@TK2MSFTNGP05.phx.gbl...
First, I think you have a lot of tests to find where the problem is...
Here are some few ideas that come to me, hope they will give you =
others...
Is the view a parameterized one ? Try to put a requery() after the =
tableupdate, just to see if the data you inserted keeps corresponding to =
the parameter.
If you always save the datas, try to set buffermode of the view to 3 =
(assuming it's currently 5).
Perhaps you should try to create a table with the same name and =
structure that the view, and test with this table in the correct =
buffermode. If the problem still occurs, perhaps it doesn't come from =
the view.
If your view is a local one, isn't the original table bufferized ? =
(all tableupdates of the view work, but the table would never be saved)
Hope this helps,
keep courage,
JC
"Max" <max@lox.com> a =E9crit dans le message de news: =
OeUI6$8uGHA.5044@TK2MSFTNGP05.phx.gbl...
Hi JCR,

>=20
> Are you sure that there is no event that clear the controlsources =
of the=20
> columns of the grid ?
>=20
Yes, I am sure, no code to clear the record source. The form works =
fine, only if a row is added the problem occurs. Here is the code in the =
click event of the button to add a row:

SELECT vwballast=20
GO BOTTOM=20
SCATTER FIELDS date, port, voy, start, stop, tank, in_out, watch =
MEMVAR
APPEND BLANK=20
REPLACE vwballast.date WITH DATE(), vwballast.port WITH m.port, ;
vwballast.voy WITH m.voy, vwballast.watch WITH m.watch=20
=3DTABLEUPDATE(1,.t.,'vwballast')=20
this.Parent.pageframe1.page1.grdBallast.SetFocus

Thats it. Only after this code the data entered in the grid are =
lost, the TABLEUPDATE does not work. I checked with the debugger, =
TABLEUPDATE reports success in each text/combo box, but the data are not =
updated.

I did change the APPEND BLANK with INSERT SQL, but no success.

thanks
Max



> "Max" <max@lox.com> a =E9crit dans le message de news:=20
> u5$$mj2uGHA.4876@TK2MSFTNGP04.phx.gbl...
>> Thanks Dan.
>> If it would be that simple it would be great. Half the data are =
there and=20
>> the other half not?
>>
>> I can open the form and enter data as much as I like, the data =
are NOT=20
>> lost, everything is there. Only if I use my "Add new Row" button =
for=20
>> adding a new row the entered data are getting lost.
>>
>> If I add a row - close and reopen the form data can be entered =
without=20
>> loss. If data are entered directly after a row has been added, =
all the=20
>> entered data are lost.
>>
>> At the moment I told my users to add a row, close the form, =
reopen it and=20
>> then enter data. It works but it cannot be that there is no =
solution for=20
>> this problem, is'nt it???
>>
>> Wolfgang
>>
>>
>> "Dan Freeman" <spam@microsoft.com> wrote in message=20
>> news:eVJo80yuGHA.1256@TK2MSFTNGP02.phx.gbl...
>>> Sounds like you didn't check "Send SQL Updates" in the view =
designer.
>>>
>>> Dan
>>>
>>> Max wrote:
>>>> I use a view to fill a grid.
>>>>
>>>> To add an additional row in the grid I provide a button on the =
form
>>>> which adds a row in the view, enters some predefiened data and =
send
>>>> an update to the view with:
>>>>
>>>> =3DTABLEUPDATE(1,.t.,'view')
>>>>
>>>> and put the focus onto the grid.
>>>>
>>>> After entering data, closing the form, reopening it again the
>>>> predefined data are there but the manually entered data are =
lost!
>>>>
>>>> In the grid in every text and combo box I put in the Valid =
Methods
>>>> the code: =3DTABLEUPDATE(1,.t.,'view')
>>>>
>>>> The problem occurs only if a new row is added to the grid/view.
>>>>
>>>> Please could someone give me an advice how to avoid the data =
loss.
>>>>
>>>> Wolfgang
>>>
>>>
>>
>>=20
>=20
>
------=_NextPart_000_000E_01C6BF28.629E5AE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2912" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi <FONT face=3D"Times New Roman"=20
size=3D3>Jean-Claude,</FONT></FONT></DIV>
<DIV>many thanks for you input.</DIV>
<DIV><FONT face=3DArial size=3D2>I think I found the problem. It is the =
TABLEUPDATE.=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>After&nbsp;appending a record and =
issueing the=20
TABLEUPDATE it seems&nbsp;the view is closing all doors. No more data =
can be=20
updated. Only after closing the form (the view is also closed) and =
reopening the=20
form date can be updated.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I had to remove all the TABLEUPDATE in =
every column=20
and I am back with only one TABLEUPDATE when leaving the grid. At the =
moment it=20
seems to work.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The funny thing is, the TABLEUPDATE is =
working fine=20
in every clolumn as long as I do not add a record. When adding a record =
and=20
sending a TABLEUPDATE the view is closed for any further data=20
input.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>That looks to me more like a BUG in VFP =

9.0</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Max</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Jean-Claude Rivi=E8re" &lt;<A=20
=
href=3D"mailto:jclriv@libreenanglais.fr">jclriv@libreenanglais.fr</A>&gt;=
wrote=20
in message <A=20
=
href=3D"news:eIvHrDFvGHA.4972@TK2MSFTNGP05.phx.gbl">news:eIvHrDFvGHA.4972=
@TK2MSFTNGP05.phx.gbl</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>First, I think you have a lot of =
tests to find=20
where the problem is...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Here are some few ideas that come to =
me, hope=20
they will give you others...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>Is the view a&nbsp;</FONT><FONT =
face=3DArial=20
size=3D2>parameterized one ? Try to put a requery() after the =
tableupdate, just=20
to see if the data you inserted keeps corresponding to the=20
parameter.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>If you always save the datas, try to =
set=20
buffermode of the view to 3 (assuming it's currently =
5).</FONT></DIV>Perhaps=20
you should try to create a table with the same name and structure that =
the=20
view, and test with this table in the correct buffermode. If the =
problem still=20
occurs, perhaps it doesn't come from the view.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>If your view is a local one, isn't =
the original=20
table&nbsp;bufferized ? (all tableupdates of the view work, but the =
table=20
would never be saved)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Hope this helps,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>keep courage,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>JC</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Max" &lt;<A href=3D"mailto:max@lox.com">max@lox.com</A>&gt; a =
=E9crit dans=20
le message de news: <A=20
=
href=3D"mailto:OeUI6$8uGHA.5044@TK2MSFTNGP05.phx.gbl">OeUI6$8uGHA.5044@TK=
2MSFTNGP05.phx.gbl</A>...</DIV>
<DIV>Hi JCR,</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&gt; <BR>&gt; Are you sure that there is no event that clear =
the=20
controlsources of the <BR>&gt; columns of the grid ?<BR>&gt; =
<BR>Yes, I am=20
sure, no code to clear the record source. The form works fine, only =
if a row=20
is added the problem occurs. Here is the code in the click event of =
the=20
button to add a row:</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>SELECT =
</FONT><FONT=20
face=3D"Courier New" size=3D2>vwballast </FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>GO BOTTOM =
</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>SCATTER =
FIELDS=20
date</FONT><FONT face=3D"Courier New" size=3D2>, port, voy, start, =
stop, tank,=20
in_out, watch </FONT><FONT face=3D"Courier New" color=3D#0000ff=20
size=3D2>MEMVAR</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#008000 size=3D2>APPEND=20
BLANK&nbsp;</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#008000 size=3D2>REPLACE =
vwballast.date=20
WITH DATE(), </FONT><FONT face=3D"Courier New" color=3D#008000=20
size=3D2>vwballast.port WITH m.port, ;</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#008000 =
size=3D2>vwballast.voy WITH m.voy,=20
</FONT><FONT face=3D"Courier New" color=3D#008000 =
size=3D2>vwballast.watch WITH=20
m.watch </FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>=3D</FONT><FONT =
face=3D"Courier New"=20
color=3D#0000ff size=3D2>TABLEUPDATE</FONT><FONT face=3D"Courier =
New"=20
size=3D2>(1,.t.,'vwballast') </FONT><FONT face=3D"Courier New" =
color=3D#0000ff=20
size=3D2></FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>this</FONT><FONT=20
face=3D"Courier New" size=3D2>.</FONT><FONT face=3D"Courier New" =
color=3D#0000ff=20
size=3D2>Parent</FONT><FONT face=3D"Courier New"=20
size=3D2>.pageframe1.page1.grdBallast.</FONT><FONT face=3D"Courier =
New"=20
color=3D#0000ff size=3D2>SetFocus</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>Thats it. =
Only after this=20
code the data entered in the grid are lost,&nbsp;the TABLEUPDATE =
does not=20
work. I checked with the debugger, TABLEUPDATE reports success in =
each=20
text/combo box, but the data are not updated.</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2>I did =
change the APPEND=20
BLANK with INSERT SQL, but no success.</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>thanks</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>Max</FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&gt; "Max" &lt;<A =
href=3D"mailto:max@lox.com">max@lox.com</A>&gt; a =E9crit=20
dans le message de news: <BR>&gt; <A=20
=
href=3D"mailto:u5$$mj2uGHA.4876@TK2MSFTNGP04.phx.gbl">u5$$mj2uGHA.4876@TK=
2MSFTNGP04.phx.gbl</A>...<BR>&gt;&gt;=20
Thanks Dan.<BR>&gt;&gt; If it would be that simple it would be =
great. Half=20
the data are there and <BR>&gt;&gt; the other half=20
not?<BR>&gt;&gt;<BR>&gt;&gt; I can open the form and enter data as =
much as I=20
like, the data are NOT <BR>&gt;&gt; lost, everything is there. Only =
if I use=20
my "Add new Row" button for <BR>&gt;&gt; adding a new row the =
entered data=20
are getting lost.<BR>&gt;&gt;<BR>&gt;&gt; If I add a row - close and =
reopen=20
the form data can be entered without <BR>&gt;&gt; loss. If data are =
entered=20
directly after a row has been added, all the <BR>&gt;&gt; entered =
data are=20
lost.<BR>&gt;&gt;<BR>&gt;&gt; At the moment I told my users to add a =
row,=20
close the form, reopen it and <BR>&gt;&gt; then enter data. It works =
but it=20
cannot be that there is no solution for <BR>&gt;&gt; this problem, =
is'nt=20
it???<BR>&gt;&gt;<BR>&gt;&gt; =
Wolfgang<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt;=20
"Dan Freeman" &lt;<A=20
href=3D"mailto:spam@microsoft.com">spam@microsoft.com</A>&gt; wrote =
in message=20
<BR>&gt;&gt; <A=20
=
href=3D"news:eVJo80yuGHA.1256@TK2MSFTNGP02.phx.gbl">news:eVJo80yuGHA.1256=
@TK2MSFTNGP02.phx.gbl</A>...<BR>&gt;&gt;&gt;=20
Sounds like you didn't check "Send SQL Updates" in the view=20
designer.<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;=20
Dan<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; Max wrote:<BR>&gt;&gt;&gt;&gt; I =
use a=20
view to fill a grid.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; To add =
an=20
additional row in the grid I provide a button on the=20
form<BR>&gt;&gt;&gt;&gt; which adds a row in the view, enters some=20
predefiened data and send<BR>&gt;&gt;&gt;&gt; an update to the view=20
with:<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;=20
=3DTABLEUPDATE(1,.t.,'view')<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; =
and put=20
the focus onto the grid.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; =
After=20
entering data, closing the form, reopening it again =
the<BR>&gt;&gt;&gt;&gt;=20
predefined data are there but the manually entered data are=20
lost!<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; In the grid in every =
text and=20
combo box I put in the Valid Methods<BR>&gt;&gt;&gt;&gt; the code:=20
=3DTABLEUPDATE(1,.t.,'view')<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; =
The=20
problem occurs only if a new row is added to the=20
grid/view.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; Please could =
someone give=20
me an advice how to avoid the data=20
loss.<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;=20
Wolfgang<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; =
<BR>&gt;=20
<BR>&gt;</DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000E_01C6BF28.629E5AE0--


Re: Update Views problem by Stefan

Stefan
Mon Aug 14 03:09:23 CDT 2006

>>> The problem occurs only if a new row is added to the grid/view.
>
> I think I found the problem. It is the TABLEUPDATE.

As Bernhard pointed out, it always makes sense to evaluate
the result of TableUpdate(), and when it fails, to use AError()
to get the reason.
From your description, my guess would be that you did not
make the PrimaryKey field updatable in the View Designer.


hth
-Stefan



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

>
> "Max" <max@lox.com> schrieb im Newsbeitrag
> news:eu3F92uvGHA.2232@TK2MSFTNGP05.phx.gbl...
> Hi Jean-Claude,
> many thanks for you input.
> I think I found the problem. It is the TABLEUPDATE.
> After appending a record and issueing the TABLEUPDATE it seems the view is closing
> all doors. No more data can be updated. Only after closing the form (the view is
> also closed) and reopening the form date can be updated.
>
> I had to remove all the TABLEUPDATE in every column and I am back with only one
> TABLEUPDATE when leaving the grid. At the moment it seems to work.
>
> The funny thing is, the TABLEUPDATE is working fine in every clolumn as long as I
> do not add a record. When adding a record and sending a TABLEUPDATE the view is
> closed for any further data input.
> That looks to me more like a BUG in VFP 9.0
>
> Thanks
> Max
>
>
> "Jean-Claude Rivière" <jclriv@libreenanglais.fr> wrote in message
> news:eIvHrDFvGHA.4972@TK2MSFTNGP05.phx.gbl...
> First, I think you have a lot of tests to find where the problem is...
> Here are some few ideas that come to me, hope they will give you others...
> Is the view a parameterized one ? Try to put a requery() after the tableupdate,
> just to see if the data you inserted keeps corresponding to the parameter.
> If you always save the datas, try to set buffermode of the view to 3 (assuming
> it's currently 5).
> Perhaps you should try to create a table with the same name and structure that
> the view, and test with this table in the correct buffermode. If the problem still
> occurs, perhaps it doesn't come from the view.
> If your view is a local one, isn't the original table bufferized ? (all
> tableupdates of the view work, but the table would never be saved)
> Hope this helps,
> keep courage,
> JC
> "Max" <max@lox.com> a écrit dans le message de news:
> OeUI6$8uGHA.5044@TK2MSFTNGP05.phx.gbl...
> Hi JCR,
>
> >
> > Are you sure that there is no event that clear the controlsources of the
> > columns of the grid ?
> >
> Yes, I am sure, no code to clear the record source. The form works fine, only
> if a row is added the problem occurs. Here is the code in the click event of the
> button to add a row:
>
> SELECT vwballast
> GO BOTTOM
> SCATTER FIELDS date, port, voy, start, stop, tank, in_out, watch MEMVAR
> APPEND BLANK
> REPLACE vwballast.date WITH DATE(), vwballast.port WITH m.port, ;
> vwballast.voy WITH m.voy, vwballast.watch WITH m.watch
> =TABLEUPDATE(1,.t.,'vwballast')
> this.Parent.pageframe1.page1.grdBallast.SetFocus
>
> Thats it. Only after this code the data entered in the grid are lost, the
> TABLEUPDATE does not work. I checked with the debugger, TABLEUPDATE reports success
> in each text/combo box, but the data are not updated.
>
> I did change the APPEND BLANK with INSERT SQL, but no success.
>
> thanks
> Max
>
>
>
> > "Max" <max@lox.com> a écrit dans le message de news:
> > u5$$mj2uGHA.4876@TK2MSFTNGP04.phx.gbl...
> >> Thanks Dan.
> >> If it would be that simple it would be great. Half the data are there and
> >> the other half not?
> >>
> >> I can open the form and enter data as much as I like, the data are NOT
> >> lost, everything is there. Only if I use my "Add new Row" button for
> >> adding a new row the entered data are getting lost.
> >>
> >> If I add a row - close and reopen the form data can be entered without
> >> loss. If data are entered directly after a row has been added, all the
> >> entered data are lost.
> >>
> >> At the moment I told my users to add a row, close the form, reopen it and
> >> then enter data. It works but it cannot be that there is no solution for
> >> this problem, is'nt it???
> >>
> >> Wolfgang
> >>
> >>
> >> "Dan Freeman" <spam@microsoft.com> wrote in message
> >> news:eVJo80yuGHA.1256@TK2MSFTNGP02.phx.gbl...
> >>> Sounds like you didn't check "Send SQL Updates" in the view designer.
> >>>
> >>> Dan
> >>>
> >>> Max wrote:
> >>>> I use a view to fill a grid.
> >>>>
> >>>> To add an additional row in the grid I provide a button on the form
> >>>> which adds a row in the view, enters some predefiened data and send
> >>>> an update to the view with:
> >>>>
> >>>> =TABLEUPDATE(1,.t.,'view')
> >>>>
> >>>> and put the focus onto the grid.
> >>>>
> >>>> After entering data, closing the form, reopening it again the
> >>>> predefined data are there but the manually entered data are lost!
> >>>>
> >>>> In the grid in every text and combo box I put in the Valid Methods
> >>>> the code: =TABLEUPDATE(1,.t.,'view')
> >>>>
> >>>> The problem occurs only if a new row is added to the grid/view.
> >>>>
> >>>> Please could someone give me an advice how to avoid the data loss.
> >>>>
> >>>> Wolfgang
> >>>
> >>>
> >>
> >>
> >
> >


Re: Update Views problem by Max

Max
Tue Aug 15 20:39:50 CDT 2006

Hi Stefan,
you are absolutely right, I did not make the PrimaryKey field updatable.

I checked some of my projects, in all my views the PrimaryKey field is not
updatable. I was not aware that this is a problem. Indeed many times I run
into problems that the data did not get uploaded. Therefore I ended up with
TABLEUPDATE and REQUERY all over the place.

To create a view I use the view designer. After selecting tables, fields,
filters etc. I move to the "Update Criteria" tab and check the PrimaryKey
field and click the button "Update All".
VFP 9.0 checks all the fields except the PrimaryKey field and I thought that
is the way it should be. Why VFP does not update all fields when clicking
"Update All"???

Your comment was of great help, thank you very much.
Wolfgang
(I did post my answer yesterday but it did not appear in the Newsgroup! If
it would be a view I would know what to do now.......)


"Stefan Wuebbe" <stefan.wuebbe@gmx.de> wrote in message
news:OfMF5j3vGHA.1224@TK2MSFTNGP03.phx.gbl...
>>>> The problem occurs only if a new row is added to the grid/view.
>>
>> I think I found the problem. It is the TABLEUPDATE.
>
> As Bernhard pointed out, it always makes sense to evaluate
> the result of TableUpdate(), and when it fails, to use AError()
> to get the reason.
> From your description, my guess would be that you did not
> make the PrimaryKey field updatable in the View Designer.
>
>
> hth
> -Stefan
>
>
>
> --
> |\_/| ------ ProLib - programmers liberty -----------------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
>
>>
>> "Max" <max@lox.com> schrieb im Newsbeitrag
>> news:eu3F92uvGHA.2232@TK2MSFTNGP05.phx.gbl...
>> Hi Jean-Claude,
>> many thanks for you input.
>> I think I found the problem. It is the TABLEUPDATE.
>> After appending a record and issueing the TABLEUPDATE it seems the view
>> is closing
>> all doors. No more data can be updated. Only after closing the form (the
>> view is
>> also closed) and reopening the form date can be updated.
>>
>> I had to remove all the TABLEUPDATE in every column and I am back with
>> only one
>> TABLEUPDATE when leaving the grid. At the moment it seems to work.
>>
>> The funny thing is, the TABLEUPDATE is working fine in every clolumn as
>> long as I
>> do not add a record. When adding a record and sending a TABLEUPDATE the
>> view is
>> closed for any further data input.
>> That looks to me more like a BUG in VFP 9.0
>>
>> Thanks
>> Max
>>
>>
>> "Jean-Claude Rivière" <jclriv@libreenanglais.fr> wrote in message
>> news:eIvHrDFvGHA.4972@TK2MSFTNGP05.phx.gbl...
>> First, I think you have a lot of tests to find where the problem is...
>> Here are some few ideas that come to me, hope they will give you
>> others...
>> Is the view a parameterized one ? Try to put a requery() after the
>> tableupdate,
>> just to see if the data you inserted keeps corresponding to the
>> parameter.
>> If you always save the datas, try to set buffermode of the view to 3
>> (assuming
>> it's currently 5).
>> Perhaps you should try to create a table with the same name and
>> structure that
>> the view, and test with this table in the correct buffermode. If the
>> problem still
>> occurs, perhaps it doesn't come from the view.
>> If your view is a local one, isn't the original table bufferized ? (all
>> tableupdates of the view work, but the table would never be saved)
>> Hope this helps,
>> keep courage,
>> JC
>> "Max" <max@lox.com> a écrit dans le message de news:
>> OeUI6$8uGHA.5044@TK2MSFTNGP05.phx.gbl...
>> Hi JCR,
>>
>> >
>> > Are you sure that there is no event that clear the controlsources
>> of the
>> > columns of the grid ?
>> >
>> Yes, I am sure, no code to clear the record source. The form works
>> fine, only
>> if a row is added the problem occurs. Here is the code in the click event
>> of the
>> button to add a row:
>>
>> SELECT vwballast
>> GO BOTTOM
>> SCATTER FIELDS date, port, voy, start, stop, tank, in_out, watch
>> MEMVAR
>> APPEND BLANK
>> REPLACE vwballast.date WITH DATE(), vwballast.port WITH m.port, ;
>> vwballast.voy WITH m.voy, vwballast.watch WITH m.watch
>> =TABLEUPDATE(1,.t.,'vwballast')
>> this.Parent.pageframe1.page1.grdBallast.SetFocus
>>
>> Thats it. Only after this code the data entered in the grid are lost,
>> the
>> TABLEUPDATE does not work. I checked with the debugger, TABLEUPDATE
>> reports success
>> in each text/combo box, but the data are not updated.
>>
>> I did change the APPEND BLANK with INSERT SQL, but no success.
>>
>> thanks
>> Max
>>
>>
>>
>> > "Max" <max@lox.com> a écrit dans le message de news:
>> > u5$$mj2uGHA.4876@TK2MSFTNGP04.phx.gbl...
>> >> Thanks Dan.
>> >> If it would be that simple it would be great. Half the data are
>> there and
>> >> the other half not?
>> >>
>> >> I can open the form and enter data as much as I like, the data are
>> NOT
>> >> lost, everything is there. Only if I use my "Add new Row" button
>> for
>> >> adding a new row the entered data are getting lost.
>> >>
>> >> If I add a row - close and reopen the form data can be entered
>> without
>> >> loss. If data are entered directly after a row has been added, all
>> the
>> >> entered data are lost.
>> >>
>> >> At the moment I told my users to add a row, close the form, reopen
>> it and
>> >> then enter data. It works but it cannot be that there is no
>> solution for
>> >> this problem, is'nt it???
>> >>
>> >> Wolfgang
>> >>
>> >>
>> >> "Dan Freeman" <spam@microsoft.com> wrote in message
>> >> news:eVJo80yuGHA.1256@TK2MSFTNGP02.phx.gbl...
>> >>> Sounds like you didn't check "Send SQL Updates" in the view
>> designer.
>> >>>
>> >>> Dan
>> >>>
>> >>> Max wrote:
>> >>>> I use a view to fill a grid.
>> >>>>
>> >>>> To add an additional row in the grid I provide a button on the
>> form
>> >>>> which adds a row in the view, enters some predefiened data and
>> send
>> >>>> an update to the view with:
>> >>>>
>> >>>> =TABLEUPDATE(1,.t.,'view')
>> >>>>
>> >>>> and put the focus onto the grid.
>> >>>>
>> >>>> After entering data, closing the form, reopening it again the
>> >>>> predefined data are there but the manually entered data are
>> lost!
>> >>>>
>> >>>> In the grid in every text and combo box I put in the Valid
>> Methods
>> >>>> the code: =TABLEUPDATE(1,.t.,'view')
>> >>>>
>> >>>> The problem occurs only if a new row is added to the grid/view.
>> >>>>
>> >>>> Please could someone give me an advice how to avoid the data
>> loss.
>> >>>>
>> >>>> Wolfgang
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>