Solved

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

Posted on 2004-09-20
5
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Six Sigma Control Plans

623 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