Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 1st, 2004, 02:24 PM
QueenVBA QueenVBA is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 22 QueenVBA User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 43 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old September 3rd, 2004, 07:52 AM
x_c4_4u x_c4_4u is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Zimbabwe
Posts: 34 x_c4_4u User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 10 m 15 sec
Reputation Power: 4
Send a message via Yahoo to x_c4_4u
Cool

i am not quite sure what you are saying but it seems you are creating a new file everytime you run your application

Reply With Quote
  #3  
Old September 3rd, 2004, 10:01 AM
QueenVBA QueenVBA is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 22 QueenVBA User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 43 sec
Reputation Power: 0
Quote:
Originally Posted by x_c4_4u
i am not quite sure what you are saying but it seems you are creating a new file everytime you run your application

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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > FileSystemObject: textfile contents erased


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway