Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a VB Expert!

Join 244,296 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 860 people online right now. Registration is fast and FREE... Join Now!




Size of text file created by VB

 
Reply to this topicStart new topic

Size of text file created by VB

thw
1 Nov, 2008 - 01:00 PM
Post #1

New D.I.C Head
*

Joined: 1 Nov, 2008
Posts: 2

I am trying to create a text file from a database, but I faced a problem if the size of the file become more than 1 MB, it takes a long time. For a file of 17000 records, it took 7 minutes. For a file of 150000 records, it tooks 143 minutes to create text file of size 6 MB. Is this acceptable or there is a limit of text file created in VB or there is a problem somewhere?

User is offlineProfile CardPM
+Quote Post


Jayman
RE: Size Of Text File Created By VB
1 Nov, 2008 - 02:32 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 8,063



Thanked: 159 times
Dream Kudos: 500
Expert In: Everything

My Contributions
No limit to a text file. I have worked with them as large as 1.5 GB, so I don't think size is the issue.

Is the DB and Text file on the same machine?

Could be network connectivity, or many other things that could be the problem.
User is online!Profile CardPM
+Quote Post

thw
RE: Size Of Text File Created By VB
2 Nov, 2008 - 03:45 AM
Post #3

New D.I.C Head
*

Joined: 1 Nov, 2008
Posts: 2

The database and the text file are in the same machine
User is offlineProfile CardPM
+Quote Post

eyesice
RE: Size Of Text File Created By VB
5 Nov, 2008 - 12:09 AM
Post #4

New D.I.C Head
*

Joined: 23 Oct, 2008
Posts: 11


My Contributions
Two more suggestions:
1. If you are iterating each record, i mean, instead fetch-write loop, fetch complete recordset in batch mode and loop to write
2. obviously you'd be using "fso", try opening the output file is append mode
CODE
Dim f As File
Dim fsoStream As TextStream
Set f = fso.GetFile("c:\junk\junk.txt")
Set fsoStream = f.OpenAsTextStream(ForAppending)


This post has been edited by eyesice: 5 Nov, 2008 - 12:13 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 04:44PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month