Agnes,
>Can an you reproduce this
Yes, I even tried with a function that is not a stored proc. A function that calls another function doing try/catch. And lastly without try/catch and with on error ...
>How can I work around
I haven't found any way. Appears that any error in the append will say 'record in use'
>Hi all,
>
>I have a nice little problem with vfp and a stored proc.
>
>In a stored proc used to append a record (default value) I try to use a
try catch. If an error in the try block happens the record will not be appended and error 1502 will be raised.
>
>Can an you reproduce this
>How can I work around
>
>code to reproduce:
>
>CREATE DATABASE mooh
>CREATE TABLE test (ix I DEFAULT new_ix())
>
>TEXT TO cHelp NOSHOW
>FUNCTION new_ix
> RETURN 12
>ENDFUNC
>ENDTEXT
>
>STRTOFILE(cHelp,'Help.txt')
>APPEND PROCEDURES FROM HELP.txt OVERWRITE
>
>USE test
>
>*runs fine
>APPEND BLANK
>
>TEXT TO cHelp NOSHOW
>FUNCTION new_ix
> TRY
> ERROR 1
> CATCH TO loException
> FINALLY
> ENDTRY
>
> RETURN 1
>ENDFUNC
>ENDTEXT
>
>STRTOFILE(cHelp,'Help.txt')
>APPEND PROCEDURES FROM HELP.txt OVERWRITE
>
>DELETE FILE Help.txt
>
>*raises error
>APPEND BLANK
>
>
>Agnes
Gregory