473,322 Members | 1,421 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,322 software developers and data experts.

Problem with reading a text file

Hi all:

I want to read a textfile from an ASP program.
My program is like this:

Set fso = CreateObject("Scripting.FileSystemObject")
workFile=http://localhost/Readme.txt)
Set textFile = FSObj.OpenTextFile(workFile)
lines = split(textFile.ReadAll, VBCrLf)
textFile.Close
Set textFile = nothing
Set fso = nothing

for index = 0 to UBound(lines)
Response.write lines(index)
next

But the program is crashing the IIS.

Think this is related to permission problem. I gave full permission to all
user accounts
in the system. still not working

Can any one help me?
Jul 19 '05 #1
2 1866
> But the program is crashing the IIS.

What the heck does "crashing" mean? Do you get an error? If so, what is
it? Else, can you describe the actual symptom, rather than the vague and
ambiguous word "crashing"?

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #2
> workFile=http://localhost/Readme.txt)
?? whether or not that's a typo, just point to the full path of the file
like so:
workfile = "c:\inetpub\wwwroot\Readme.txt"
and put it in quotes
THEN worry about the rest of your routine...

you should read up on a bit of error trapping.

add this line to the top of your the abovementioned routine

On Error Resume Next

and below it:

if Err.Number <> 0 then
Response.write Err.Description
Response.end
end if
at least you'll be able to give us a little more than "the program is
crashing the IIS"

cheers and good luck
"Suchi" <su***@inapp.com> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
Hi all:

I want to read a textfile from an ASP program.
My program is like this:

Set fso = CreateObject("Scripting.FileSystemObject")
workFile=http://localhost/Readme.txt)
Set textFile = FSObj.OpenTextFile(workFile)
lines = split(textFile.ReadAll, VBCrLf)
textFile.Close
Set textFile = nothing
Set fso = nothing

for index = 0 to UBound(lines)
Response.write lines(index)
next

But the program is crashing the IIS.

Think this is related to permission problem. I gave full permission to all
user accounts
in the system. still not working

Can any one help me?

Jul 19 '05 #3

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

Similar topics

1
by: fabrice | last post by:
Hello, I've got trouble reading a text file (event viewer dump) by using the getline() function... After 200 - 300 lines that are read correctly, it suddenly stops reading the rest of the...
2
by: Sabin Finateanu | last post by:
Hi I'm having problem reading a file from my program and I think it's from a procedure I'm using but I don't see where I'm going wrong. Here is the code: public bool AllowUsage() { ...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
2
by: Mad Scientist Jr | last post by:
i'm trying to read a file byte by byte (and later alter the data and write it to a 2nd file byte by byte) and running into a problem where it seems to keep reading the same byte over and over again...
5
by: Scott M. Lyon | last post by:
I've just discovered a bug in some code I wrote a little while ago, and I need you guys' help to fix it. My program imports data from a standard Excel Spreadsheet (just with specific column...
0
by: Fabrice | last post by:
Hello, (Alain) Tis is a part of my code to retrieve text from hastable in memory cache, by reading (befor) a resources file. Thanks for your help. /1/ The resources file * I have create a...
6
by: Bill Nguyen | last post by:
I'm reading a CSV file with the date colum formatted as "YYMMDD" -"070310" when viewed in notepad or similar trext editor. However, in my app, using ODBCReader, the column value becomes "70310"...
5
by: Neil Crighton | last post by:
I'm using the zipfile library to read a zip file in Windows, and it seems to be adding too many newlines to extracted files. I've found that for extracted text-encoded files, removing all instances...
1
by: stoogots2 | last post by:
I have written a Windows App in C# that needs to read a text file over the network, starting from the end of the file and reading backwards toward the beginning (looking for the last occurrence of a...
27
by: Jeff | last post by:
Im trying to figure out why I cant read back a binary file correctly. I have the following union: #define BITE_RECORD_LEN 12 typedef union { unsigned char byte; struct { unsigned char type;...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.