|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
FileSystemObject: textfile contents erased
Code:
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(dlgMain.FileName)
Set a = f.OpenAsTextStream(varFileNum)
Hey guys, When I open a file as a textstream (Code above) and hit the (X) to close the form and exit program before using it in the program (Not Graceful exit), It erases the text in the file and I get a blank file left over. (same name) Is there something I am not doing at the end. Why does it erase the text in the file? Last edited by QueenVBA : September 1st, 2004 at 02:28 PM. Reason: Changes |
|
#2
|
|||
|
|||
|
i am not quite sure what you are saying but it seems you are creating a new file everytime you run your application
![]() |
|
#3
|
|||
|
|||
|
Quote:
I am not creating a new file, I am just reading it. Got some help from someone. I have to close the textstream object, and the open file Code:
a.Close close #varFileNum |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > FileSystemObject: textfile contents erased |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|