473,241 Members | 1,607 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,241 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 1865
> 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: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
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...

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.