Solved

File IO

Posted on 2004-04-02
7
148 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
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

760 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

19 Experts available now in Live!

Get 1:1 Help Now