Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: mk sharma
  Where is mk sharma?
 mumbai
 India
 mk sharma
 To: mk sharma
  Where is mk sharma?
 mumbai
 India
 mk sharma
 Tags
Subject: RE: andykr class"updres" to handle conflict
Thread ID: 210886 Message ID: 211235 # Views: 46 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Saturday, January 10, 2009 3:01:36 PM         
   


how to use this class in parent and child mode.

andykr please help me.

warm regards,
mk.

> 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.



COMPLETE THREAD
andykr class"updres" to handle conflict Posted by mk sharma @ 1/8/2009 10:46:59 AM
RE: andykr class"updres" to handle conflict Posted by mk sharma @ 1/10/2009 3:01:36 PM
RE: andykr class"updres" to handle conflict Posted by Andy Kramek @ 1/11/2009 3:11:42 PM