How to use a DB record with ASP code to display HT

Results 1 to 2 of 2

Thread: How to use a DB record with ASP code to display HT

  1. #1
    Join Date
    Dec 1969

    Default How to use a DB record with ASP code to display HT

    I hv an ACESS DB in which fields contain the HTML code to build different pages.<BR>Records where I hv ASP Code in the field do not create the HTML page as intended but outputs the raw ASP code in the HTML Page.<BR><BR>For eg the ASP page that extracts the records from the DB have something like:<BR><BR>&#060;%Pg=Trim(request.QueryString("p g"))<BR> str="Select * from Pages WHERE Page_Name =&#039;" & Pg & "&#039;"<BR> set rspage=nuconn.execute(str) <BR> If not rspage.EOF Then%&#062;<BR> &#060;%=rspage("Page_Text")%&#062;<BR><BR>The DB field &#039;Page_Text has the HTML code that outputs the different pages.<BR><BR>But if this DB field has ASP code the output simply ignores all the ASP code and simply spits it all in raw HTML<BR>eg the cod " &#060;head&#062;&#060;script&#062;&#060;!--#INCLUDE FILE="products.asp"--&#062;&#060;/script&#062;&#060;/head&#062; " in the DB record does not work as intended.<BR><BR>Is there any way this can be achieved?<BR><BR>Thks a lot in advance<BR>

  2. #2
    Join Date
    Dec 1969

    Default Yep, limitation of ASP and SSI

    Server-Side Includes happen *BEFORE* ASP even gets control. Long before VBScript gets the already-combined source.<BR><BR>You can&#039;t alter the source code that you are currently processing from within that same code. Period.<BR><BR>Look here:<BR><BR>and here (which is effectively exactly the same thing you are doing, just from a DB instead of from a file)<BR><BR>Note the "short answer" in that second one.<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