473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

write <% and %> to file in asp

Hi,
I try to create a file, but failure.
My code like is:

<%
dim fs
dim tfile
strNum = """1005"""
strInfolink = "snum = " & strSiteNum

set fs=Server.CreateObject("Scripting.FileSystemObject ")
set tfile=fs.CreateTextFile("D:\Inetpub\wwwroot\html\i nfolink.asp")
tfile.WriteLine("<%")
tfile.WriteLine(strInfolink)
tfile.WriteLine("%>")
tfile.close
set tfile=nothing
set fs=nothing
%>
Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/html/testing.asp, line 28

tfile.WriteLine("
-----------------^

The problem is '<%', if I take this out, everything is fine.
Thanks.
--
Mark
Jul 19 '05 #1
9 4200
Add a second % sign in both lines.

Mike Ober.

"Mark" <mm***@hotmaill.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,
I try to create a file, but failure.
My code like is:

<%
dim fs
dim tfile
strNum = """1005"""
strInfolink = "snum = " & strSiteNum

set fs=Server.CreateObject("Scripting.FileSystemObject ")
set tfile=fs.CreateTextFile("D:\Inetpub\wwwroot\html\i nfolink.asp")
tfile.WriteLine("<%")
tfile.WriteLine(strInfolink)
tfile.WriteLine("%>")
tfile.close
set tfile=nothing
set fs=nothing
%>
Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/html/testing.asp, line 28

tfile.WriteLine("
-----------------^

The problem is '<%', if I take this out, everything is fine.
Thanks.
--
Mark

Jul 19 '05 #2
Even better.

Cheers!

Anthony Sullivan

"Michael D. Ober" <obermd-@-alum-mit-edu-nospam> wrote in message
news:8i****************@news.uswest.net...
Add a second % sign in both lines.

Mike Ober.

"Mark" <mm***@hotmaill.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,
I try to create a file, but failure.
My code like is:

<%
dim fs
dim tfile
strNum = """1005"""
strInfolink = "snum = " & strSiteNum

set fs=Server.CreateObject("Scripting.FileSystemObject ")
set tfile=fs.CreateTextFile("D:\Inetpub\wwwroot\html\i nfolink.asp")
tfile.WriteLine("<%")
tfile.WriteLine(strInfolink)
tfile.WriteLine("%>")
tfile.close
set tfile=nothing
set fs=nothing
%>
Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/html/testing.asp, line 28

tfile.WriteLine("
-----------------^

The problem is '<%', if I take this out, everything is fine.
Thanks.
--
Mark


Jul 19 '05 #3
Give this a try Mark...

tfile.WriteLine(chr(60) & "%")
tfile.WriteLine(strInfolink)
tfile.WriteLine("%" & chr(62))

Cheers!

Anthony Sullivan

"Mark" <mm***@hotmaill.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,
I try to create a file, but failure.
My code like is:

<%
dim fs
dim tfile
strNum = """1005"""
strInfolink = "snum = " & strSiteNum

set fs=Server.CreateObject("Scripting.FileSystemObject ")
set tfile=fs.CreateTextFile("D:\Inetpub\wwwroot\html\i nfolink.asp")
tfile.WriteLine("<%")
tfile.WriteLine(strInfolink)
tfile.WriteLine("%>")
tfile.close
set tfile=nothing
set fs=nothing
%>
Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/html/testing.asp, line 28

tfile.WriteLine("
-----------------^

The problem is '<%', if I take this out, everything is fine.
Thanks.
--
Mark

Jul 19 '05 #4
> tfile.WriteLine("<%")

tfile.writeline "<" & "%"

Jul 19 '05 #5
Thanks All
Mark


"Mark" <mm***@hotmaill.com> wrote in message
news:#L**************@tk2msftngp13.phx.gbl...
Hi,
I try to create a file, but failure.
My code like is:

<%
dim fs
dim tfile
strNum = """1005"""
strInfolink = "snum = " & strSiteNum

set fs=Server.CreateObject("Scripting.FileSystemObject ")
set tfile=fs.CreateTextFile("D:\Inetpub\wwwroot\html\i nfolink.asp")
tfile.WriteLine("<%")
tfile.WriteLine(strInfolink)
tfile.WriteLine("%>")
tfile.close
set tfile=nothing
set fs=nothing
%>
Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/html/testing.asp, line 28

tfile.WriteLine("
-----------------^

The problem is '<%', if I take this out, everything is fine.
Thanks.
--
Mark

Jul 19 '05 #6
> took a long time to process and still not working.

Maybe you could tell us what "not working" means...
Jul 19 '05 #7
The file is not produced. I type http://localhost/createfile.asp in address
bar, and the status bar doesn't move but sounds like IIS engine is trying to
process the file but failed.

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
took a long time to process and still not working.


Maybe you could tell us what "not working" means...

Jul 19 '05 #8
<<<<but sounds like IIS engine is trying to process the file but failed>>>>
So, what exactly does that sound like?

vroooommm, vroooommm, sputter, cough, clunk?

:>)

Bob Lehmann

"John Davis" <jr*******@hotmail.com> wrote in message
news:uT**************@tk2msftngp13.phx.gbl...
The file is not produced. I type http://localhost/createfile.asp in address bar, and the status bar doesn't move but sounds like IIS engine is trying to process the file but failed.

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
took a long time to process and still not working.


Maybe you could tell us what "not working" means...


Jul 19 '05 #9
Why do you think it's a syntax issue? Do you have the Norton Virus?
http://www.aspfaq.com/2180


"John Davis" <jr*******@hotmail.com> wrote in message
news:uT**************@tk2msftngp13.phx.gbl...
The file is not produced. I type http://localhost/createfile.asp in address bar, and the status bar doesn't move but sounds like IIS engine is trying to process the file but failed.

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
took a long time to process and still not working.


Maybe you could tell us what "not working" means...


Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Brett | last post by:
We have an application where the iusr_<srvr> has write NTFS permissions to a folder under the wwwroot (i.e. wwwroot\folder) and also there is a SQL Server database where we must give the...
4
by: matatu | last post by:
Hi to all, I have a xml file, a substring like: &lt;a href=&quot;#&quot;&gt;text&lt;/a&gt; which after an xslt trasform is rendered as (using xsl:output method html): &lt;a...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
2
by: jason hirst | last post by:
Hi, I've created a simple application that reads data from a SQL Server, and appends this to an XML file. The problem is, that the XML data structure seems to go to the top level when I write...
2
by: polilop | last post by:
OK i know it sounds little bit wierd but here is what i have to do. I have a database in which i store questions and answers, but the questions are about HTML, Javascript, ASP...... So i store...
11
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a...
3
by: Manish Sawjiani | last post by:
Dear experts i have just migrated from asp to asp.net and i am missing the loop for creating tables. while in asp one could just start a loop anywhere withing <% %is this out of style in the...
5
by: Nathan Sokalski | last post by:
My Web.config file contains the following section to register some of my UserControls: <pages> <controls> <add tagPrefix="NATE" tagName="Banner" src="~/Banner.ascx"/> <add tagPrefix="NATE"...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.