Thanks Alan very interesting method.
Only problem is that adding to stored procedures is not allowed in a runtime executable. However I have been looking into this further and wonder if it might be possible to copy the object code into the code field of the StoredProceduresObject record of the dbc (record 4)...
I have been trying this all day now and some times it works but other times the source needs to be copied into record 3 and the database recompiled otherwise the procedure is not found.
Oh well, for a while there I really thought that was going to do it. Nice idea but back to the drawing board again.
Cheers,
Nick