469,327 Members | 1,128 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

Writing to a file

Can I write to a binary file from a VB script?

I get a syntax error:

Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Web2_Local/custquery.asp, line 180, column 21
Open "DOWNLOAD.FIL" For Binary Access Write As #1
Many thanks.
Jul 19 '05 #1
4 2530
You're trying to use Visual Basic code in your ASP page. Use VB Script.
There is no "open file for input as #1" or anything like that in VBS like in
VB. Download the Windows Scripting Host documentation and read up on the
File Scripting Object.

http://www.microsoft.com/downloads/d...displaylang=en

Ray at home

--
Will trade ASP help for SQL Server help
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:OC**************@TK2MSFTNGP10.phx.gbl...
Can I write to a binary file from a VB script?

I get a syntax error:

Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Web2_Local/custquery.asp, line 180, column 21
Open "DOWNLOAD.FIL" For Binary Access Write As #1
Many thanks.

Jul 19 '05 #2
In your IIS manager, pull up the properties of your site, or your
application. Home directory tab. Configuration (under application
settings). App debugging tab. Uncheck the debugging options.

That's my guess, anyway.

Ray at home

--
Will trade ASP help for SQL Server help
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:Oi*************@TK2MSFTNGP10.phx.gbl...
Response.Clear removes most of the extraneous bytes -- but still leaves

<!--METADATA TYPE="ASP_DEBUG_INFO"
-->

at the beginning.

Jul 19 '05 #3
Perhaps this has to do with your debugging mode? Let's hope for that.

Ray at home

--
Will trade ASP help for SQL Server help
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
That link:
http://www.aspfaq.com/show.asp?id=2161


is very interesting. Works like a champ -- except that it prefaces the
binary data with 3.5k of header bytes -- any idea why? I'm still looking
through the docs. on this.

Regards,

Andrew

Jul 19 '05 #4
Found the problem! I was running in debug mode within VI 6.0. That puts the
header there and it can't be removed. Run it from localhost, or whatever,
and the header disappears.

Regards.

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Perhaps this has to do with your debugging mode? Let's hope for that.

Ray at home

--
Will trade ASP help for SQL Server help
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
That link:
http://www.aspfaq.com/show.asp?id=2161


is very interesting. Works like a champ -- except that it prefaces the
binary data with 3.5k of header bytes -- any idea why? I'm still looking
through the docs. on this.

Regards,

Andrew


Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

48 posts views Thread by Joseph | last post: by
6 posts views Thread by Sebastian Kemi | last post: by
3 posts views Thread by ishekar | last post: by
2 posts views Thread by melanieab | last post: by
reply views Thread by Yunus's Group | last post: by
16 posts views Thread by Claudio Grondi | last post: by
6 posts views Thread by arne.muller | last post: by
3 posts views Thread by Barry Flynn | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.