473,405 Members | 2,141 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,405 software developers and data experts.

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 2607
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

48
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential...
6
by: Sebastian Kemi | last post by:
How should a write a class to a file? Would this example work: object *myobject = 0; tfile.write(reinterpret_cast<char *>(myobject), sizeof(*object)); / sebek
3
by: ishekar | last post by:
Hi, I have an application where i want to write data to a file, the data is being sent from an external source. I know the total size of the data and then i retrieve the data in small segments...
1
by: Daniel | last post by:
System.IO.StreamWriter Close or Flush method to shut down the computer in such a way that just part of the file is written? or an empty file is written? Also if the Close or Flush is to a...
2
by: melanieab | last post by:
Hi, I'm trying to store all of my data into one file (there're about 140 things to keep track of). I have no problem reading a specific string from the array file, but I wasn't sure how to...
4
by: HNguyen | last post by:
Hi, I have a Web application in ASP.NET. My Application allows the users upload files into the server after checking their user names and passwords. For each transaction, the Web program will...
0
by: Yunus's Group | last post by:
Yunus's Group May 23, 3:36 pm show options Newsgroups: microsoft.public.dotnet.languages.vb From: "Yunus's Group" <yunusasm...@gmail.com> - Find messages by this author Date: 23 May 2005...
16
by: Claudio Grondi | last post by:
I have a 250 Gbyte file (occupies the whole hard drive space) and want to change only eight bytes in this file at a given offset of appr. 200 Gbyte (all other data in that file should remain...
6
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
3
by: Barry Flynn | last post by:
Hi I am working with a VB 2005 program which has been converted from VB6. It writes data out to a flat file, with code like the following line WriteLine(riFileNo, "Hist", lsAssetID,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.