Solved

File IO

Posted on 2004-04-02
7
154 Views
Last Modified: 2010-05-02
What is the fastest method for accessing information within a file in Visual Basic.  I have tried various methods of opening a file but all of them are extremely slow across a network situation.  I have tried all of the vb calls that are built within.  Is there an api or any faster way to get at data within the files?  

0
Comment
Question by:JBlackham
[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
7 Comments
 
LVL 11

Expert Comment

by:YohanShminge
ID: 10745347
You're not going to go any faster than your network will allow, no matter what method you choose.  Its going to be limited by the speed and traffic on your network.
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 10745381
Opening what file?
Answer depends on the file type.

and as mentioned above you also have network bottleneck and no matter you use VB or C++

it is there.


As a general rule if the file is a stand alone its better to copy the file to the local computer instead of working with
over the Network.




0
 
LVL 7

Expert Comment

by:Burbble
ID: 10746321
I don't know which you've tried, but I've found that using

Dim b() as Byte
Get #1, , b()

is much, much, much faster than using

b() = InputB(LOF(1), #1)

I'd say that as a rule, use the Binary Get/Put functions instead of the Input/InputB/Print functions whenever possible.

-Burbble
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 10747571
Maybe if you do the file copy accross the network in two steps

step 1) copy the data across the network store in memory
step 2) write the entire block of data to hard disk in 1 step.



just a suggestion.
Brian
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11441136
PAQed - no points refunded (of 125)

modulo
Community Support Moderator
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

690 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