Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Parse ASP contained in Microsoft Access Table


Message #1 by "Eric Levine" <eric@d...> on Thu, 17 Jan 2002 16:55:54
Good morning... I am hoping someone can help me.  



I am building an application in ASP and MS-ACCESS where I have a need to

store HTML and ASP code in a Memo Field. 



When I make a call to this memo field, In MS-IE the data presents itself

properly, with the ASP getting parsed by IIS.  In Netscape however, the ASP

delimiters are not being processed, so with the HTML code I am receiving

the non-parsed ASP code (ie. Hello there <% =rsCustomer("name") %>) rather

than "Hello there Fred".



Does anyone know if it is possible to add HTML and ASP code to an MS-ACCESS

DB Field (Memo, Text, etc.) and have it read by Netscape Browsers?



My reasons for doing it this way is to provide a way to edit the HTML/ASP

through a web-based administrative interface, rather then editing the code

directly offline.



AN EXAMPLE WOULD BE:



ACCESS DB TABLE:

Table: Config

Memo Field: Global Header

Value: <B>Hello There</B>, <% =rsCustomers("name") %>



CODE:

Response.Write rsConfig("global_header")



Thank you all in advance for your help.
Message #2 by Thomas Bellavia <TBellavia@V...> on Thu, 17 Jan 2002 12:05:29 -0500
Maybe use URLEncode on the string first?





-----Original Message-----

From: Eric Levine [mailto:eric@d...]

Sent: Thursday, January 17, 2002 11:56 AM

To: Access ASP

Subject: [access_asp] Parse ASP contained in Microsoft Access Table





Good morning... I am hoping someone can help me.  



I am building an application in ASP and MS-ACCESS where I have a need to

store HTML and ASP code in a Memo Field. 



When I make a call to this memo field, In MS-IE the data presents itself

properly, with the ASP getting parsed by IIS.  In Netscape however, the ASP

delimiters are not being processed, so with the HTML code I am receiving

the non-parsed ASP code (ie. Hello there <% =rsCustomer("name") %>) rather

than "Hello there Fred".



Does anyone know if it is possible to add HTML and ASP code to an MS-ACCESS

DB Field (Memo, Text, etc.) and have it read by Netscape Browsers?



My reasons for doing it this way is to provide a way to edit the HTML/ASP

through a web-based administrative interface, rather then editing the code

directly offline.



AN EXAMPLE WOULD BE:



ACCESS DB TABLE:

Table: Config

Memo Field: Global Header

Value: <B>Hello There</B>, <% =rsCustomers("name") %>



CODE:

Response.Write rsConfig("global_header")



Thank you all in advance for your help.




Message #3 by "Eric Levine" <eric@d...> on Thu, 17 Jan 2002 12:21:39 -0500
Thanks for your reply.  I am afraid that did not work.



-----Original Message-----

From: Thomas Bellavia [mailto:TBellavia@V...] 

Sent: Thursday, January 17, 2002 12:05 PM

To: Access ASP

Subject: [access_asp] RE: Parse ASP contained in Microsoft Access Table



Maybe use URLEncode on the string first?





-----Original Message-----

From: Eric Levine [mailto:eric@d...]

Sent: Thursday, January 17, 2002 11:56 AM

To: Access ASP

Subject: [access_asp] Parse ASP contained in Microsoft Access Table





Good morning... I am hoping someone can help me.  



I am building an application in ASP and MS-ACCESS where I have a need to

store HTML and ASP code in a Memo Field. 



When I make a call to this memo field, In MS-IE the data presents itself

properly, with the ASP getting parsed by IIS.  In Netscape however, the

ASP

delimiters are not being processed, so with the HTML code I am receiving

the non-parsed ASP code (ie. Hello there <% =rsCustomer("name") %>)

rather

than "Hello there Fred".



Does anyone know if it is possible to add HTML and ASP code to an

MS-ACCESS

DB Field (Memo, Text, etc.) and have it read by Netscape Browsers?



My reasons for doing it this way is to provide a way to edit the

HTML/ASP

through a web-based administrative interface, rather then editing the

code

directly offline.



AN EXAMPLE WOULD BE:



ACCESS DB TABLE:

Table: Config

Memo Field: Global Header

Value: <B>Hello There</B>, <% =rsCustomers("name") %>



CODE:

Response.Write rsConfig("global_header")



Thank you all in advance for your help.




$subst('Email.Unsub').






$subst('Email.Unsub').







Message #4 by "Scott Reed" <scottr@m...> on Thu, 17 Jan 2002 12:51:29 -0600
I'm not entirely sure that this CANT be done the way you're trying to do it

but...



I believe that if you have ASP embedded within the text of your database

record, it

will be not be executed because your code is executed prior to writing out

to the browser.



You may want to look into Stored Procedures or writing a Global Include file

that does

the work for you. In this case, you would write a function that collects the

UserID and

builds a Welcome Message. The result would be something like...



<!--#include virtual="includes/incGlobal.inc"-->

<!--#include virtual="includes/header.inc"-->

<%WRITE_WELCOME_MESSAGE%>

<!--#include virtual="includes/footer.inc"-->



Again, I'm not totally sure you can't get code stored in a database record

to execute

but I was not able to. I have found that building reusable functions to

build page content

was more effective and solved the same problem. Now, all of my pages look

like....



<!--#include virtual="includes/incGlobal.inc"--> 'contains all site

functions, database connection, etc

<!--#include virtual="includes/header.inc"-->



	<%WRITE_WELCOME_MESSAGE%>			'Gets UserID and builds a welcome message

	<%WRITE_SEARCH%>					'Presents a search feature

	<%WRITE_THISPAGE_CONTENT%>			'can make a function that builds each page of

website

	<%CLEAN_UP%>					'closes db conn and sets everything to nothing



<!--#include virtual="includes/footer.inc"-->









-----Original Message-----

From: Eric Levine [mailto:eric@d...]

Sent: Thursday, January 17, 2002 4:56 PM

To: Access ASP

Subject: [access_asp] Parse ASP contained in Microsoft Access Table





Good morning... I am hoping someone can help me.



I am building an application in ASP and MS-ACCESS where I have a need to

store HTML and ASP code in a Memo Field.



When I make a call to this memo field, In MS-IE the data presents itself

properly, with the ASP getting parsed by IIS.  In Netscape however, the ASP

delimiters are not being processed, so with the HTML code I am receiving

the non-parsed ASP code (ie. Hello there <% =rsCustomer("name") %>) rather

than "Hello there Fred".



Does anyone know if it is possible to add HTML and ASP code to an MS-ACCESS

DB Field (Memo, Text, etc.) and have it read by Netscape Browsers?



My reasons for doing it this way is to provide a way to edit the HTML/ASP

through a web-based administrative interface, rather then editing the code

directly offline.



AN EXAMPLE WOULD BE:



ACCESS DB TABLE:

Table: Config

Memo Field: Global Header

Value: <B>Hello There</B>, <% =rsCustomers("name") %>



CODE:

Response.Write rsConfig("global_header")



Thank you all in advance for your help.







  Return to Index