943,822 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 2616
  • ASP RSS
Jan 10th, 2006
0

asp code generated as text, needed to be seen as asp code again. databses backup

Expand Post »
hi

i have a page that generates asp code as text.

this all works well, but i need the same page to take the generated code and use it as asp again. is this even possible?

<% VARdate = "date()"
' now to use the VARdate
response.write(VARdate) %>

this is just an example. the code im working with checks to see what tables are available from a mysql database, runs an explain on them (to see what columns there are) then it runs a recordset outputing the data of those columns.

im trying to create a way of backing up a database with JUST asp.

if i could only get asp to read code thats in "text" as asp code, im sure it would work. cause if i take the generated code on IE. place it in an asp document it works fine.

PLEASE SAY ITS POSSIBLE and how to go about it
Similar Threads
Reputation Points: 10
Solved Threads: 2
Junior Poster
william_stam is offline Offline
131 posts
since Mar 2005
Jan 11th, 2006
0

Re: asp code generated as text, needed to be seen as asp code again. databses backup

There are two ways to go about this, if I understand what you are trying to do correctly.

The first would be to create a file from the generated 'text', and save it as an asp file. That code in that file could then be included/executed from a subsequent page.

The second, and probably cleaner method, is to use the variables created in the 'text' in later code. A simple combination of check routines and loops should do the trick.
Reputation Points: 16
Solved Threads: 7
Junior Poster
Lafinboy is offline Offline
166 posts
since Jul 2004
Jan 11th, 2006
0

Re: asp code generated as text, needed to be seen as asp code again. databses backup

"A simple combination of check routines and loops should do the trick."


how????? ive started with the generate asp pages of code then execute but idealy i want it to out pu the whole thing to a text file so that goes out the window.

basicaly i want a asp variable thats in text
var = "date()" to be later on read as date(), asp code, this is just an example
Reputation Points: 10
Solved Threads: 2
Junior Poster
william_stam is offline Offline
131 posts
since Mar 2005
Jan 20th, 2006
0

Re: asp code generated as text, needed to be seen as asp code again. databses backup

I think i know the solution for you.

Try using the Server.Execute method.

ASP Syntax (Toggle Plain Text)
  1. <%
  2.  
  3. VARdate = "date()"
  4.  
  5. ' now to use the VARdate
  6. response.write(Server.Execute(VARdate)) %>
Reputation Points: 25
Solved Threads: 7
Junior Poster
Drew is offline Offline
166 posts
since Apr 2004
Jan 24th, 2006
0

Re: asp code generated as text, needed to be seen as asp code again. databses backup

server.execute doesnt work. what does work (compliments of "vbs in a nutshell") is
ASP Syntax (Toggle Plain Text)
  1. dim S
  2. S = "sub Proc2 : "
  3. S = S & "dim x : "
  4. S = S & "x = 10 : "
  5. S = S & "MsgBox x : "
  6. S = S & "End Sub "
  7.  
  8. Execute S
  9. Proc2

as i understand it executing "s" only uses the code that "s" is linked to, the variable "s" does nothing. once you have executed then you still have to do something with it. in this case call the sub.

i havent tried this in my case yet, havent had the time yet. will do so soon i hope.
Reputation Points: 10
Solved Threads: 2
Junior Poster
william_stam is offline Offline
131 posts
since Mar 2005
Jan 24th, 2006
0

Re: asp code generated as text, needed to be seen as asp code again. databses backup

Sorry my bad... "Execute" is what i meant to say, not "Server.Execute". I posted really late and was really tired. I just wasnt thinking very clear :s
Reputation Points: 25
Solved Threads: 7
Junior Poster
Drew is offline Offline
166 posts
since Apr 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: Accessing ADSI Query from ASP page
Next Thread in ASP Forum Timeline: Designing an Intranet using ASP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC