Error condition on IDE EXIT
Posted: Fri May 17, 2013 9:54 pm
I keep having an error condition in the IDE for a stack that access a Database.
When the program is on a card that access a DB record, I have a function in the on CloseCard handler to SAVE the record that is active when the user leaves the card.
If I EXIT the IDE when I'm on one of these cards I get the following error condition that lock the program.
Stack "DatabaseControl" execution error at line n/a
(External Handler: exception) near 'revdberr, invalid connection id'
And the window display the SAVE function at the following code:
put revdb_execute( gConID, tSQL ) into tTemp
I've put the following code in the on CloseStack handler to attempt to delay until the card is closed, but keep getting the problem.
on closeStack
wait for 400 millisecond with messages
if gConID is an Integer AND gConID > 0 then
get closeDB() -- close the database
put 0 into gConID
end if
stop using stack "DataBaseControl"
close stack me
end closeStack
I believe that LiveCode is closing the database before the card is closed, so the database ID saved in gConID is invalid.
Is there a way to force close the card before closing the database?
Thanks for the help.
When the program is on a card that access a DB record, I have a function in the on CloseCard handler to SAVE the record that is active when the user leaves the card.
If I EXIT the IDE when I'm on one of these cards I get the following error condition that lock the program.
Stack "DatabaseControl" execution error at line n/a
(External Handler: exception) near 'revdberr, invalid connection id'
And the window display the SAVE function at the following code:
put revdb_execute( gConID, tSQL ) into tTemp
I've put the following code in the on CloseStack handler to attempt to delay until the card is closed, but keep getting the problem.
on closeStack
wait for 400 millisecond with messages
if gConID is an Integer AND gConID > 0 then
get closeDB() -- close the database
put 0 into gConID
end if
stop using stack "DataBaseControl"
close stack me
end closeStack
I believe that LiveCode is closing the database before the card is closed, so the database ID saved in gConID is invalid.
Is there a way to force close the card before closing the database?
Thanks for the help.