Question How do I allow more than one instance of VB App to access data files?

deanobravo

Member
Joined
Dec 31, 2011
Messages
9
Location
Christchurch, New Zealand
Programming Experience
10+
Hi
I have just completed an upgrade of a VB6 app to VB.net (2008). Everything works as it should except for one (essential) part.
I cannot open more than one instance of the built app without getting a file access error.
Now don't laugh but my program uses Random Access files to store the data (i know, i know the 1990's called and they want their programmer back).
Anyway I've been using this method since the early 90's and it's never let me down.
Until now that is. VB6 allowed any number of users to access the files but for some reason VB.net gives the following error:

The process cannot access the file "C:\blah blah" because it is being used by another process.

Any help appreciated.
 
Did not like the look of that!
But that's ok it led me to the realization that the Fileopen Function I am using also has a FileShare parameter.
VB6 also has a similar parameter but it seems "Shared" is the default.
Everything works fine now.

Cheers Mate.
 
Back
Top