Solved

Can’t   write   huge data to text files Using VB .

Posted on 2004-09-20
5
257 Views
Last Modified: 2006-11-17
Dear Experts
In my VB application I m downloading sales data  to  text files .
I have problem with  writing in  text files  which stored only a specific amount of data  
Is there any restriction on writing  number of bytes to text files ? If yes then how I should resolve this problem .
Awaiting for  your reply.

0
Comment
Question by:rehman123
5 Comments
 
LVL 1

Accepted Solution

by:
anupbhunia earned 500 total points
ID: 12102735
Dear Friend,

As i know there is no restriction in text file size.

are you concating the text in string variable? or are you keeping the text in any textBox control before writing to the text file? If you did, change logic. Apped to the text file directly.

Dim fs As FileSystemObject
Dim fst As TextStream
Set fst = fs.OpenTextFile("YourFile", ForAppending)

Do
   fst.Write YourText$
loop
0
 
LVL 13

Expert Comment

by:bochgoch
ID: 12103438
There are no restrictions -- check your diskspace / operating system permissions...

Please let us see the code that you're using to write to file.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 12103841
rehman123,

My suggestion is: Save your data to a Richtext file. It isn't much difficult to do so, nor will you need to make many change in your code. Use RichTextBox activex control to do that. With RTB you can store large amounts of data which is not possible with plain TextBox.
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 12104283
Well,

There is no restriction but the problem may occur on your clipboard. when you copy the data, it may be too large to be saved to text file. Try to fragment the data that you want to copy.

I hope that helps....
0
 

Author Comment

by:rehman123
ID: 12104568
Actually my problem was  i was writing to  textbox control  and  from there i was writing on text file , anupbhunia adviced me to write directly on text file and it worked , so i guess i must give all points to bhunia .
thanks .
bye.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now