all groups > inetserver asp general > december 2006 >
You're in the

inetserver asp general

group:

possible to store server side scripts on sql server?


Re: possible to store server side scripts on sql server? McKirahan
12/29/2006 12:29:01 PM
inetserver asp general: [quoted text, click to view]

You're just returning the string of ASP code.

Try using Eval() to apply it -- untested.

Re: possible to store server side scripts on sql server? Justin Piper
12/29/2006 1:28:22 PM
On Fri, 29 Dec 2006 12:29:01 -0600, McKirahan <News@McKirahan.com> wrote=
:

[quoted text, click to view]

That has a lot of limitations. Foremost, it's highly insecure, but it al=
so =

defeats IIS's script context caching (so every statement will have to be=
=

recompiled with every page load), prevents you from keeping your code =

under revision control, and makes it impossible to use templates (i.e., =
=

you would need to use Response.Write "hello" rather than <%=3D "hello" %=
[quoted text, click to view]

A better design might be to store an identifier in the table, and then u=
se =

GetRef() to resolve it to a function, e.g:

<% Set rs =3D conn.Execute("SELECT title FROM table1")
Set f =3D GetRef(rs("title"))
f()
%>

<% Function SayHello() %>
hello
<% End Function %>

-- =

Justin Piper
Bizco Technologies
possible to store server side scripts on sql server? User
12/30/2006 1:54:05 AM
HI,

i intend to save some asp scripts on the server.

eg: i store this script on the server

<%="hello"%>

i save this under table "table1" , column name "title"

then i proceed to write out the server script:

set rs = conn.execute("select title from table1")
response.write rs("title")

but the results doesnt execute the stored asp script.

am i doing the wrong way?

i intend to store some asp server scripts on the server...

thanks



Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
Re: possible to store server side scripts on sql server? Bob Barrows [MVP]
12/30/2006 6:12:51 AM
You should read this:
http://blogs.msdn.com/ericlippert/archive/2003/11/01/53329.aspx

[quoted text, click to view]

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: possible to store server side scripts on sql server? McKirahan
12/30/2006 8:45:34 AM
[quoted text, click to view]

That's for JScript not VBScript; though even that article states:
"There are a few scenarios in which eval is invaluable.".

[snip]

[quoted text, click to view]

[snip]

[quoted text, click to view]


Re: possible to store server side scripts on sql server? User
12/30/2006 9:16:35 AM
Thanks !

Got it!

I've used Execute() instead.

Without the eval() tip, i wouldnt have found execute()

=)

[quoted text, click to view]



Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
Re: possible to store server side scripts on sql server? Bob Barrows [MVP]
12/30/2006 10:37:51 AM
[quoted text, click to view]

The same reasoning applies to Execute. A new compiler is spawned consuming
resources and impairing performance.
Part two of the series
(http://blogs.msdn.com/ericlippert/archive/2003/11/04/53335.aspx) describes
the security hole opened by the use of these methods.

[quoted text, click to view]
And this is not one of the situations he describes.
Justin described a perfectly workable alternative to Execute, but as usual,
the alternatives look a little harder and the Execute/Eval crutch is picked
up.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

AddThis Social Bookmark Button