Ignacio:
Como Siempre, mucho mas sencillo y funciona mejor.
Gracias por tu tiempo.
Paco V
=?iso-8859-1?Q?Ignacio_Ortiz_de_Z=FA=F1iga?= <
NoName@xailer.com> wrote:
>
>
>Paco,=20
>
>Entiendo. No me hab=EDa fijado que eran distintos DataSets.=20
>
>Este c=F3digo=20
>
>>>> if :nModalResult =3D=3D mrOK
>>>> ::oDbfDataSet2:AddNew()
>>>> if ::oDbfDataset2:RecLock()
>>>> for n :=3D 1 to 91
>>>> ::oDbfDataSet2:Fieldput(n, ::oDbfDataSet1:Fieldget(n) )
>>>> next n
>>>> :oDbfDataSet2:modi :=3DAPPDATA:usuarop
>>>> ::oDbfDataSet2:mome :=3Ddtos(date())+"-"+time()+"/A"
>>>> ::oDbfDataSet2:Update()
>>>> ::oDbfDataset2:RecUnLock()
>
>se debe sustituir por este:
>
>if :nModalResult =3D=3D mrOK
> WITH OBJECT ::oDbfDataSet2
> :AddNew()
> for n :=3D 1 to 91
> :VarPut(n, ::oDbfDataSet1:Fieldget(n) )
> next n
> :modi :=3DAPPDATA:usuarop
> :mome :=3Ddtos(date())+"-"+time()+"/A"
> :Update()
> END WITH
>Endif
>
>Saludos
>
>"Paco V" <
ssi@ono.com> escribi=F3 en el mensaje =
>news:4486fbbd$[email=
1@ozsrvnegro.ozlan.local...]
1@ozsrvnegro.ozlan.local...[/email]
>>=20
>> El edit va sobre ::odBfDataSet1
>> y despues addnew lo hago sobre ::odBfDataSet2
>>=20
>> Es correcto?
>>=20
>>=20
>>=20
>> "Ignacio Ortiz de Z=FA=F1iga" <
NoName@xailer.com> wrote:
>>>Paco,
>>>
>>>No tiene sentido hacer un Addnew() despu=E9s de un Edit(). O el uno o
=
>el otro,
>>=20
>>>pero no los dos a la vez.
>>>
>>>Un saludo,
>>>
>>>"Paco V" <
ssi@ono.com> escribi=F3 en el mensaje=20
>>>news:4486edde$[email=
1@ozsrvnegro.ozlan.local...]
1@ozsrvnegro.ozlan.local...[/email]
>>>>
>>>> Me ha servido las dos opciones, y he hecho esto:
>>>>
>>>> WITH OBJECT oFrm :=3D TForm5():CreateForm( Self )
>>>> :cText :=3D "Traspasar AGENTES a Hist=F3rico"
>>>> ::oDbfDataSet1:edit() //Dejo editar para cambiar
>>>> :ShowModal()
>>>> if :nModalResult =3D=3D mrOK
>>>> ::oDbfDataSet2:AddNew()
>>>> if ::oDbfDataset2:RecLock()
>>>> for n :=3D 1 to 91
>>>> ::oDbfDataSet2:Fieldput(n, ::oDbfDataSet1:Fieldget(n) )
>>>> next n
>>>> :oDbfDataSet2:modi :=3DAPPDATA:usuarop
>>>> ::oDbfDataSet2:mome :=3Ddtos(date())+"-"+time()+"/A"
>>>> ::oDbfDataSet2:Update()
>>>> ::oDbfDataset2:RecUnLock()
>>>> endif
>>>> endif
>>>> :END()
>>>> END WITH
>>>>
>>>> Y me falla el bloqueo de registros. =BFCreo que bajo mi l=F3gica =
>esta bien
>>=20
>>>> pero
>>>> que puede estar mal?
>>>>
>>>> Gracias
>>>> Paco V
>>>>
>>>>
>>>> "Manu Exposito" <
messoft@gmail.com> wrote:
>>>>>Como te dice Ignacio copias la tabla como tal sin cambios, incluso =
>podrias
>>>>
>>>>>hacer una copia directamente cuando sepas que estan cerradas=20
>>>
>>>
>>
>
><!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.2873" name=3DGENERATOR>
><STYLE></STYLE>
></HEAD>
><BODY>
><DIV><FONT face=3DArial size=3D2>Paco, </FONT></DIV>
><DIV><FONT face=3DArial size=3D2></FONT> </DIV>
><DIV><FONT face=3DArial size=3D2>Entiendo. No me hab=EDa fijado que eran
=
>distintos=20
>DataSets. </FONT></DIV>
><DIV><FONT face=3DArial size=3D2></FONT> </DIV>
><DIV><FONT face=3DArial size=3D2>Este c=F3digo </FONT></DIV>
><DIV><FONT face=3DArial size=3D2></FONT> </DIV>
><DIV><FONT face=3DArial size=3D2>>>> if :nModalResult =3D=3D=20
>mrOK<BR>>>> ::oDbfDataSet2:AddNew()<BR>>>> =
>if=20
>::oDbfDataset2:RecLock()<BR>>>> for n :=3D 1 to=20
>91<BR>>>> ::oDbfDataSet2:Fieldput(n,=20
>::oDbfDataSet1:Fieldget(n) )<BR>>>> next=20
>n<BR>>>> :oDbfDataSet2:modi=20
>:=3DAPPDATA:usuarop<BR>>>> ::oDbfDataSet2:mome=20
>:=3Ddtos(date())+"-"+time()+"/A"<BR>>>> =20
>::oDbfDataSet2:Update()<BR>>>> =20
>::oDbfDataset2:RecUnLock()<BR></FONT></DIV>
><DIV><FONT face=3DArial size=3D2>se debe sustituir por =
>este:</FONT></DIV>
><DIV><FONT face=3DArial size=3D2></FONT> </DIV>
><DIV><FONT face=3DArial size=3D2><FONT face=3D"Courier New">if =
>:nModalResult =3D=3D=20
>mrOK</FONT></FONT></DIV>
><DIV><FONT face=3DArial size=3D2><FONT face=3D"Courier =
>New"> WITH=20
>OBJECT ::oDbfDataSet2<BR> =20
>:AddNew()<BR> for n :=3D 1 to=20
>91<BR> =
>:VarPut(n,=20
>::oDbfDataSet1:Fieldget(n) )</FONT></FONT></DIV>
><DIV><FONT face=3DArial size=3D2><FONT face=3D"Courier =
>New"> =20
> next =
>n<BR> :modi=20
>:=3DAPPDATA:usuarop<BR> :m=
>ome=20
>:=3Ddtos(date())+"-"+time()+"/A"<BR> &=
>nbsp; :Update()<BR> =20
>END WITH</FONT></FONT></DIV>
><DIV><FONT face=3DArial size=3D2><FONT face=3D"Courier =
>New">Endif</FONT></FONT></DIV>
><DIV><FONT face=3DArial size=3D2><FONT face=3D"Courier =
>New"></FONT></FONT> </DIV>
><DIV><FONT face=3DArial size=3D2><FONT=20
>face=3D"Courier New">Saludos</FONT></DIV></FONT>
><DIV><FONT face=3DArial size=3D2></FONT> </DIV>
><DIV><FONT face=3DArial size=3D2>"Paco V" <</FONT><A=20
>href=3D"mailto:
ssi@ono.com"><FONT face=3DArial =
>size=3D2>
ssi@ono.com</FONT></A><FONT=20
>face=3DArial size=3D2>> escribi=F3 en el mensaje </FONT><A=20
>href=3D"news:4486fbbd$
1@ozsrvnegro.ozlan.local"><FONT face=3DArial=20
>size=3D2>news:4486fbbd$
1@ozsrvnegro.ozlan.local</FONT></A><FONT =
>face=3DArial=20
>size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>> <BR>> El =
>edit va sobre=20
>::odBfDataSet1<BR>> y despues addnew lo hago sobre=20
>::odBfDataSet2<BR>> <BR>> Es correcto?<BR>> <BR>> <BR>> =
><BR>>=20
>"Ignacio Ortiz de Z=FA=F1iga" <</FONT><A =
>href=3D"mailto:
NoName@xailer.com"><FONT=20
>face=3DArial size=3D2>
NoName@xailer.com</FONT></A><FONT face=3DArial =
>size=3D2>>=20
>wrote:<BR>>>Paco,<BR>>><BR>>>No tiene sentido hacer un =
>
>Addnew() despu=E9s de un Edit(). O el uno o el otro,<BR>> =
><BR>>>pero no=20
>los dos a la vez.<BR>>><BR>>>Un =
>saludo,<BR>>><BR>>>"Paco=20
>V" <</FONT><A href=3D"mailto:
ssi@ono.com"><FONT face=3DArial=20
>size=3D2>
ssi@ono.com</FONT></A><FONT face=3DArial size=3D2>> =
>escribi=F3 en el mensaje=20
><BR>>>news:4486edde$[email=
1@ozsrvnegro.ozlan.local...]
1@ozsrvnegro.ozlan.local...[/email]<BR>>>><BR>=
>>>>=20
>Me ha servido las dos opciones, y he hecho =
>esto:<BR>>>><BR>>>>=20
>WITH OBJECT oFrm :=3D TForm5():CreateForm( Self )<BR>>>> :cText =
>:=3D=20
>"Traspasar AGENTES a Hist=F3rico"<BR>>>>=20
>::oDbfDataSet1:edit() //Dejo editar para=20
>cambiar<BR>>>> :ShowModal()<BR>>>> if :nModalResult =
>=3D=3D=20
>mrOK<BR>>>> ::oDbfDataSet2:AddNew()<BR>>>> =
>if=20
>::oDbfDataset2:RecLock()<BR>>>> for n :=3D 1 to=20
>91<BR>>>> ::oDbfDataSet2:Fieldput(n,=20
>::oDbfDataSet1:Fieldget(n) )<BR>>>> next=20
>n<BR>>>> :oDbfDataSet2:modi=20
>:=3DAPPDATA:usuarop<BR>>>> ::oDbfDataSet2:mome=20
>:=3Ddtos(date())+"-"+time()+"/A"<BR>>>> =20
>::oDbfDataSet2:Update()<BR>>>> =20
>::oDbfDataset2:RecUnLock()<BR>>>> endif<BR>>>>=20
>endif<BR>>>> :END()<BR>>>> END=20
>WITH<BR>>>><BR>>>> Y me falla el bloqueo de registros. =
>=BFCreo=20
>que bajo mi l=F3gica esta bien<BR>> <BR>>>> =
>pero<BR>>>> que=20
>puede estar mal?<BR>>>><BR>>>> Gracias<BR>>>> =
>Paco=20
>V<BR>>>><BR>>>><BR>>>> "Manu Exposito" =
><</FONT><A=20
>href=3D"mailto:
messoft@gmail.com"><FONT face=3DArial=20
>size=3D2>
messoft@gmail.com</FONT></A><FONT face=3DArial size=3D2>>=20
>wrote:<BR>>>>>Como te dice Ignacio copias la tabla como tal =
>sin=20
>cambios, incluso podrias<BR>>>><BR>>>>>hacer una =
>copia=20
>directamente cuando sepas que estan cerradas=20
><BR>>><BR>>><BR>></FONT></BODY></HTML>
>
>