Re: not insert to table by Cindy
Cindy
Sun Feb 01 10:10:01 CST 2004
In news: O2x7v1M6DHA.2908@tk2msftngp13.phx.gbl,
W.Tang <anonymous@discussions.microsoft.com.invalid> wrote:
> sales set to buffering-3
> salesdetail set to buffering-5
>
> begin transaction
> insert into sales(...blah blah blah)
> insert into salesdetail(...blah blah blah)
> if (tableupdate(0, .f., "sales") and tableupdate(1, .f.,
> "salesdetail")) end transaction
>
> strange thing is, I got salesdetail updated but sales always got
> nothing. no error message pop out.
Hi Wandy,
The following worked for me; I wonder what's happening in your data that's
not happening in mine. Does it make any difference to update SalesDetail
first? What about using two nested IFs?
CREATE DATABASE TestBuffering
CREATE TABLE Sales (PK I)
CURSORSETPROP("Buffering", 3)
CREATE TABLE SalesDetail (PK I, FK I)
CURSORSETPROP("Buffering", 5)
BEGIN TRANSACTION
INSERT INTO Sales VALUES (1)
INSERT INTO SalesDetail VALUES (10, 1)
INSERT INTO SalesDetail VALUES (11, 1)
IF (TABLEUPDATE(0, .F., "Sales") AND ;
TABLEUPDATE(1, .F., "Salesdetail"))
MESSAGEBOX("Successful")
ELSE
MESSAGEBOX("Unsuccssful")
ENDIF
END TRANSACTION
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org www.cindywinegarden.com