AndrewMozley
Programmer
I have developed a form (FRM_X) which can be invoked within a larger application (APP_Y). I have not developed the larger application (APP_Y) and do not have the source code for it.
Within my form I gather information from controls, and if all goes well I post records to several tables, mainly appending records. So the code in FRM_X says something like
IF . . all has gone well . . .
BEGIN TRANSACTION
SELECT DBF123
APPEND BLANK
REPLACE Fld1 WITH mydata1, Fld2 WITH mydata2 . . .
. . . .
(more tables)
END TRANSACTION
ENDIF
(Optional breakpoint)
Usually this works OK, but sometimes it does not. I can run this program up to a breakpoint after I have completed the transaction, and can see my new data (at this breakpoint) sitting happily at the end of the various tables.
However (when it fails) the records have clearly not been written to the tables. I can exit from application APP_Y; then when I examine the tables using VFP the records are not there.
Is it possible that I am operating within a nested transaction (within APP_Y), so that what I think I have saved is being over-ruled by APP_Y?
And is there any way that I can protect myself? I do not wish to compromise the integrity of APP_Y, but is there any command that I can issue with my code (FRM_X) which effectively says
"Really, really save these records" ?
Guidance much appreciated.
Within my form I gather information from controls, and if all goes well I post records to several tables, mainly appending records. So the code in FRM_X says something like
IF . . all has gone well . . .
BEGIN TRANSACTION
SELECT DBF123
APPEND BLANK
REPLACE Fld1 WITH mydata1, Fld2 WITH mydata2 . . .
. . . .
(more tables)
END TRANSACTION
ENDIF
(Optional breakpoint)
Usually this works OK, but sometimes it does not. I can run this program up to a breakpoint after I have completed the transaction, and can see my new data (at this breakpoint) sitting happily at the end of the various tables.
However (when it fails) the records have clearly not been written to the tables. I can exit from application APP_Y; then when I examine the tables using VFP the records are not there.
Is it possible that I am operating within a nested transaction (within APP_Y), so that what I think I have saved is being over-ruled by APP_Y?
And is there any way that I can protect myself? I do not wish to compromise the integrity of APP_Y, but is there any command that I can issue with my code (FRM_X) which effectively says
"Really, really save these records" ?
Guidance much appreciated.