Forum Moderators: open

Message Too Old, No Replies

file system object problems

must just be me...

         

macrost

6:23 pm on May 17, 2004 (gmt 0)

10+ Year Member



Here's what I'm trying to accomplish. I am updating a db then right after that, I want to create a file by using fso.
Here is what I have so far:

response.write(bodysql)
response.write(server.mappath("/herbal-library/"))
response.end
Set rsupdate = conn.Execute(bodysql)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
set fname = fso.OpenTextFile(Server.MapPath("/herbal-library/") & page_name ,2,true)
'fname.WriteLine("<!--#include file=""includes/header.asp""-->" & vbcrlf)
fname.WriteLine("<table cellpadding=""0"" cellspacing=""0"" width = ""90%"">" & vbcrlf)
fname.WriteLine("<tr>" & vbcrlf & "<td valign=""top"" class=""body"">" & vbcrlf)
fname.WriteLine("<table cellpadding=""0"" cellspacing=""0"">" & vbcrlf)
fname.WriteLine("<tr>" & vbcrlf & "<td>" & "<%=indexrs(""body_content"")%>" & "</td>" & vbcrlf)
fname.WriteLine("</tr>" & vbcrlf "</table>" & vbcrlf)
fname.WriteLine("</td>" & vbcrlf & "</tr>" & vbcrlf)
fname.WriteLine("</table>"& vbcrlf)
'fname.WriteLine("<!--#include file=""includes/footer.asp""-->")
fname.Close

Now the problem is, it isn't even hitting my sql response.write and the response.end. It's all being passed up.
Anyone have any ideas?

Ok, on second thought....
I'm trying to write an include line into the file. However, and include is processed immediately upon execution of page, and it doesn't care about asp comments.
How do I get around this?

IanTurner

7:03 pm on May 17, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



To write the include try splitting it into two strings

fname.WriteLine("<!--#incl" & "ude file=""includes/header.asp""-->" & vbcrlf)

TheNige

1:24 am on May 20, 2004 (gmt 0)

10+ Year Member



try putting response.flush before your response.end

Easy_Coder

1:44 am on May 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



--> response.write(bodysql)

You've indicated that this line of code is not executing. Is there code executing before this line that we have not seen?