|
-
Aug 14th, 2000, 03:18 AM
#1
Thread Starter
New Member
I am using text file saved in common delimintaer format,
I am running an extenal program to save the file (monday.txt which already exists at the time of trying to save it)
One of my data contol acces this file.
then i try to overwrite the existing monday.txt file it tells me file in use)
Pls help
-
Aug 14th, 2000, 03:50 AM
#2
Member
If the form with your data control is still visible, that means that the file is in use by the data control. Windows won't let you overwrite the file if it is open. One way of closing it is to unload the form with the data control. Otherwise use some other method of accessing the data, which doesn't need the data control.
If you could show some of the code you are using it would be easier to show you the solution.
Barend
JHB-SA
Nothing is impossible, except skiing through a revolving door.
-
Aug 14th, 2000, 06:06 AM
#3
Thread Starter
New Member
Thanks
ill unload the form
thanks
-
Oct 10th, 2000, 11:01 AM
#4
Junior Member
I have a similar problem NEED HELP
My application reads a txt file using OPEN / CLOSE. Even after the application is ended, the file is in a state that will not allow the Delete function of Windows Explorer to work. What is returned is this message
"Error Deleting File
Cannot delete tempea: Access is denied
Make sure the disk is not full or write-protected
and that the file is not currently in use."
If I reboot my PC, then I can delete the file with Windows Explorer.
What can I do within my VB program to make this file available for normal use??
-
Oct 10th, 2000, 12:14 PM
#5
Junior Member
Close does not CLOSE File
I found a chunk of code to test whether a file was open or closed. Put it in at the end of my application and when found the file open, I used the CLOSE #5 to close the file in question. I had called the code chunk a second time to see if the file was open or closed. IT IS STILL OPEN!!
That is why I get the problem in my previous posting.
How can I close the file? Or figure out why it is still OPEN??
-
Oct 11th, 2000, 02:15 AM
#6
Member
Please post some code, maybe I can help.
Barend
JHB-SA
Nothing is impossible, except skiing through a revolving door.
-
Oct 11th, 2000, 06:35 AM
#7
Junior Member
To bar
Thanks for the offer, but I changed the thread to the correct group... General VB and with some help have found what seems to be a problem. If my opened file is on a local D:\ drive my app works great. If my opened file is on a network drive, then the file remains open even if I use the same close command that works for a local drive.
-
Oct 11th, 2000, 07:23 AM
#8
Member
That is because the server system on the other machine takes a while to refresh (Up to 20 seconds). You'll find that if you wait a couple of seconds and then test for the open file, it will be closed.
I asume this thread can be closed now.
Barend
JHB-SA
Nothing is impossible, except skiing through a revolving door.
-
Oct 11th, 2000, 07:52 AM
#9
Junior Member
To rressa
You are the owner of this thread, as suggested by bar, would you close this thread. Thanks...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|