[thelist] storing dynamic text in database

David.Cantrell at Gunter.AF.mil David.Cantrell at Gunter.AF.mil
Wed Oct 2 14:39:01 CDT 2002

>text in db:
>How are you today, <%=name%>
>how can I put this in the DB so it evaluates as "How are you today, Joe"

It won't evaluate in the DB, but you can use the database as storage for
templates, then parse the templates when you retrieve them.

Since it looks like you are using ASP, here's one way. This is simply
template parsing, taking the template from the DB instead of a file. Decide
on a format for template variables, then Replace() them with their values.

	[DB Record]
	"How are you today, {name}"

	... put field into variable named sTemplate ...
	response.write Replace( sTemplate, "{name}", oRs.Fields( FieldName
).Value )


More information about the thelist mailing list