Re: Input past end of file
From: John Nurick (j.mapSoN.nurick_at_dial.pipex.com)
Date: 09/07/04
- Next message: mikewells: "How do I place fields on a subform in specific place"
- Previous message: Dirk Goldgar: "Re: Input past end of file"
- In reply to: Tran Hong Quang: "Input past end of file"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 07 Sep 2004 06:32:49 +0100
Hi Quang,
The first thing I'd try is using the FileSystemObject object and opening
the file as a TextStream rather than a binary file. Use
TextStream.ReadLine to read lines.
Otherwise, its necessary to know more about your file, the "binary
characters" it contains, and what you want to happen to them. If it's
possible for the "binary characters" to include CRLF pairs that do not
signal linebreaks you will certainly have to write custom code to parse
the file.
On Mon, 6 Sep 2004 18:27:01 -0700, Tran Hong Quang
<TranHongQuang@discussions.microsoft.com> wrote:
>Hi,
> I have following code:
>
>Open strFileName For Binary Access Read Shared As intInputFileHandler
>While (Not EOF(intInputFileHandler)
> Line Input #intInputFileHandler, strBuff 'Read one line
> ..................
> ..................
>
>Wend
>
>It always read over the end of file. The error message is "Input past end of
>file"
>
>If I change open mode like this:
>Open strFileName For Input Shared As intInputFileHandler
>
>It won't read over the end of file anymore. But the input file isn't 100%
>text file, sometime it has binary characters. Thus reading process may stop
>before it reach the end of file because it find EOF character inside the file.
>
>So, if the input file has multiple lines, but sometime it can have binary
>characters, what is the best way to open and read the whole file line by line
>?
>
>Thanks
>Quang
-- John Nurick [Microsoft Access MVP] Please respond in the newgroup and not by email.
- Next message: mikewells: "How do I place fields on a subform in specific place"
- Previous message: Dirk Goldgar: "Re: Input past end of file"
- In reply to: Tran Hong Quang: "Input past end of file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|