FileOpen

Z

zurg

Hi!
I have a specific problem - I need to take some informations from a .txt
file from another computer...
I use OpenFile and the program runs perfectly...
But when I run it second time I get an error... I'm unable to give it
characterist because I have to run the program on a computer without
VS.Net...
I know only that program stops for about 10s on a line with "OpenFile"
command and there returns an error.
But if I wait before re-starting my program about a minute at the second
start it works fine... So mayby it leaves something in memory?
Help!

Code look like this (short version):

Public Sub Main
Dim fileadress As String

Dim q As Integer

Dim line As String

q = FreeFile()

fileadress = \\somenetworkadres\cmdata\file.txt

FileOpen(q, fileadress, OpenMode.Input)

Do Until EOF(q)

line = LineInput(q)

(Here I get the information from this line to my program)

Loop

FileClose(q)

End Sub
 
C

Cor

Hi Zurg,

What is the type of the computer, I tried it and also no problems even when
I had putted in a loop of 1000 times ?

Cor
 
Z

zurg

Hi Cor,
Yes, you're right - I opened and closed the .txt about 20 times without any
problems...
The error occur only in one situation:
1. I start a connection and open and close the file
2. Disconnect
3. Once again establish the same connection and try to open the same file -
i get an error
And it occurs only if I do this points quite fast...
It seems that somewhere in it's memory windows "remember" that there was a
file opened and try to re-open it with the old connection which alredy
doesn't exists... Because if it has a while to get information about new
connection it works perfectly...
In fackt I have no idea how to re-load this "memory" - of course I can kill
explorer and run it once again but it's quite drastic...
I'm afraid I just have to accept that specific error...
Anyway, thanks for attention

zurg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top