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