When writing out the stored asp code from the database, you need to
execute it rather than just copy the "source", which as far as ASP knows, is just
some text.
There is a way to do this: use the
eval()
function. See
VBScript Eval function[
^]
Whilst this may resolve your problem, it is (a) very inefficient, and (b) very dangerous - in terms of security. If you don't have control over that database-stored ASP code, it could be doing virtually anything on your server. Unless this is a tightly-pinned down application with access control, I would advise against it and rethink your application design.