Hi,
I am using table buffering. I plan to code it as the following:
Customer.Add(cust_id, cust_name)
INSERT INTO tblCustomer VALUES(cust_id, cust_name)
IF TABLEUPDATE(1,.F.,"tblCustomer")
RETURN .T.
ENDIF
Account.Add(Cust_id)
LOCAL lcAccNo
lcAccNo = GETNEXTNO()
INSERT INTO tblAccount VALUES(lcAccNo, Cust_ID)
IF TABLEUPDATE(1,.F.,"tblAccount")
RETURN .T.
ENDIF
Does it design correct?
The problem now is, where should I place my BEGIN TRANSACTION, TABLREVERT()?
As I know, If I put BEGIN TRANSACTION in function that call the both, VFP will cofuse with "WHAT SHOULD BE ROLLBACK", it may rollback but return unexpected result.
Any ideas or sample?
Thank you
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...