Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 29th, 2006, 05:55 PM
User
Guest
 
Posts: n/a
Default possible to store server side scripts on sql server?

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 **
----------------------------------------------------------
http://www.usenet.com
  #2  
Old December 29th, 2006, 06:35 PM
McKirahan
Guest
 
Posts: n/a
Default Re: possible to store server side scripts on sql server?

"User" <user@emailwrote in message
news:1167414683_4507@sp6iad.superfeed.net...
Quote:
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...
You're just returning the string of ASP code.

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


  #3  
Old December 29th, 2006, 07:35 PM
Justin Piper
Guest
 
Posts: n/a
Default Re: possible to store server side scripts on sql server?

On Fri, 29 Dec 2006 12:29:01 -0600, McKirahan <News@McKirahan.comwrote:
Quote:
"User" <user@emailwrote in message
news:1167414683_4507@sp6iad.superfeed.net...
Quote:
>HI,
>>
>i intend to save some asp scripts on the server.
>>
>eg: i store this script on the server
>>
><%="hello"%>
>
You're just returning the string of ASP code.
>
Try using Eval() to apply it -- untested.
That has a lot of limitations. Foremost, it's highly insecure, but it also
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 <%= "hello" %>).

A better design might be to store an identifier in the table, and then use
GetRef() to resolve it to a function, e.g:

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

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

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
  #4  
Old December 30th, 2006, 01:15 AM
User
Guest
 
Posts: n/a
Default Re: possible to store server side scripts on sql server?

Thanks !

Got it!

I've used Execute() instead.

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

=)

"McKirahan" <News@McKirahan.comwrote in message
news:FeWdnU7Blfx9wAjYnZ2dnUVZ_silnZ2d@comcast.com. ..
Quote:
"User" <user@emailwrote in message
news:1167414683_4507@sp6iad.superfeed.net...
Quote:
>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...
>
You're just returning the string of ASP code.
>
Try using Eval() to apply it -- untested.
>
>


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
  #5  
Old December 30th, 2006, 11:25 AM
Bob Barrows [MVP]
Guest
 
Posts: n/a
Default Re: possible to store server side scripts on sql server?

You should read this:
http://blogs.msdn.com/ericlippert/ar.../01/53329.aspx

User wrote:
Quote:
Thanks !
>
Got it!
>
I've used Execute() instead.
>
Without the eval() tip, i wouldnt have found execute()
>
=)
>
"McKirahan" <News@McKirahan.comwrote in message
news:FeWdnU7Blfx9wAjYnZ2dnUVZ_silnZ2d@comcast.com. ..
Quote:
>"User" <user@emailwrote in message
>news:1167414683_4507@sp6iad.superfeed.net...
Quote:
>>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...
>>
>You're just returning the string of ASP code.
>>
>Try using Eval() to apply it -- untested.
>>
>>
>
>
>
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
--
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"


  #6  
Old December 30th, 2006, 02:45 PM
McKirahan
Guest
 
Posts: n/a
Default Re: possible to store server side scripts on sql server?

"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcomwrote in message
news:OUzhuNALHHA.4376@TK2MSFTNGP03.phx.gbl...That's for JScript not VBScript; though even that article states:
"There are a few scenarios in which eval is invaluable.".

[snip]
Quote:
Quote:
"McKirahan" <News@McKirahan.comwrote in message
news:FeWdnU7Blfx9wAjYnZ2dnUVZ_silnZ2d@comcast.com. ..
[snip]
Quote:
Quote:
Quote:
Try using Eval() to apply it -- untested.


  #7  
Old December 30th, 2006, 03:45 PM
Bob Barrows [MVP]
Guest
 
Posts: n/a
Default Re: possible to store server side scripts on sql server?

McKirahan wrote:
Quote:
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcomwrote in message
news:OUzhuNALHHA.4376@TK2MSFTNGP03.phx.gbl...>
That's for JScript not VBScript; though even that article states:
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/ar.../04/53335.aspx) describes
the security hole opened by the use of these methods.
Quote:
"There are a few scenarios in which eval is invaluable.".
>
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"


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles