ASP script being called from a database won't

Results 1 to 4 of 4

Thread: ASP script being called from a database won't

  1. #1
    Aaron F Guest

    Default ASP script being called from a database won't

    I have some ASP ADO script that calles some ASP script from a database and embeds it into the code of the web page. The only problem is that the code won&#039t execute on the server and shows up in the source with the <% and %> which means it wasn&#039t run. Any ideas?

  2. #2
    SPG Guest

    Default Compiler came and went...

    And while it was here, it dragged in your code from the database. But it didn&#039t care what it was, because it was just strings being delivered from an ADODB.RecordSet (which is what it did care about).<BR><BR>For efficiency reasons, the compiler will only ever go over your code once. If your code is not there when the compiler is, that&#039s too bad for your code.<BR><BR>This is why we love our SSI! (Although devalued in IIS ASP pages, the #include still works.) What happens is this:<BR><BR>1) You write your script with a &#060;!-- #include file="" --&#062; in it.<BR>2) You browse your website for your script. (easy so far, yes?)<BR>3) The preprocessing bits of your server go through and replace every &#060;!-- #include ... --&#062; with the literal text comments from the file at "..."<BR>4) The ASP compiler goes through the literal text script -- both in the script and #included into it -- and makes a useful (we hope) little app of it.<BR>5) The Server drops the output of the app into a web-page shaped HTTP package and ships it to you...<BR>6) ...where you realize that your table sizes need some tweaking.<BR><BR>HiH

  3. #3
    Join Date
    Dec 1969

    Default RE: ASP script being called from a database won�

    This won&#039t work - ASP executes the read from the database and then renders it as HTML when you try to write it.<BR>I&#039m not sure why you did this but here are 2 guesses and workarounds:<BR>1. You will be re-using the code quite often.<BR> Solution: put it into an Include file and call when needed.<BR>2. You will be executing it conditionally.<BR> Solution: Use case statements, if then statements or similar.<BR><BR>If you&#039re doing this for another reason, let the board know. We can find a workaround.<BR><BR><BR>

  4. #4
    Join Date
    Dec 1969

    Default RE: Compiler came and went...

    Just a word of caution - when using includes, the extension should be .asp or other security in place. There&#039s a security risk in using non-.asp as an extension since a user would be able to download the file as text.<BR>There&#039s 2 articles on this issue here on 4Guys:<BR><BR>and<BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts