> i am using a class designed by andykr "updres"
>
> this class works very well with a single table but not working proper with more than one table like
>
>
> llok = tableupdate(.t.,.f.,"inward1") and tableupdate(.t.,.f.,"inward")
>
>
> if a real conflict than i want to take same step for both the tables
>
> Force my changes OR Undo my Change for both the table.
>
> in my save command button
>
> do updbuffer2 with "inward1",thisform.datasessionid,"inward"
>
> but this class works with one alias
>
> attachment is "updres" class
>
http://www.foxite.com/uploads/d54eebe9-4fbf-4503-b3ce-079f951ca1a7.rar>
> below is my "updbuffer2.prg"
>
>
> procedure updbuffer2
> ****
> parameters updbufferalias, updbufferdatasessionid, updbufferalias1
> *Parameters updbufferalias, updbufferdatasessionid
> local llOk, llOk1, oUpd, laErr[1]
> *** Select the main table
> select &updbufferalias && child table
> *** Try and update
> *** If update fails, create the conflict resolution object
> if not empty(updbufferalias1)
> llOk = tableupdate(.t.,.f.,(updbufferalias)) and tableupdate(.t.,.f.,(updbufferalias1))
> else
> llOk = tableupdate(.t.,.f.,(updbufferalias))
> endif
> if ! llOk
> aerror( laErr )
> if laErr[1] = 1585
> oUpd = createobject('updres', updbufferdatasessionid, alias())
> if type( 'oUpd' ) = "O" and ! isnull( oUpd )
> oUpd.show()
> endif
> else
> *** What other error could we get here?
> messagebox( message(), 16, "Whoops!" )
> endif
> endif
> *ENDIF
> *** Refresh the for
>
>
> warm regards,
> mk.
I am sorry, this class is not designed to handle multiple table updates and I have neither the time, nor any interest, in modifying it to handle that scenario because that is NOT good practice. If you need multiple table updates, use a transaction and handle the updates separately and handle conflicts separately.
You have the source code, if you can't make it do what you want why are you asking me to?
Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA