Phantom File when running VB6 program

stickerman

New Member
Messages
1
Good day, my first visit here.

I have a Lenovo laptop running Windows 8.1. I run a number of VB6 programs. One is an estimating system that makes use of .dat files. When I first install the program and the files, everything works fine.

The problem comes when I 'over-write' a .dat file with a newer version, with some basic cost changes (the file updated on a different computer which contains VB6). As I 'paste' from a USB stick it asks if I want to over-write, which I obviously agree to.

However, as I run the program, I still appear to be using data from the previous file! The latest update figures are ignored.

To check this out further, I have even deleted (removed completely) the .dat file from the appropriate directory, but when running the program it still inputs data from the original file.

This leads me to believe there must be another copy of the file open somewhere (hence the phantom!), possibly as a 'last used' reference.

I have been on to the taskbar and ensured I have unchecked the two boxes about retaining files etc.

Can anyone tell me what is going on: am I doing something wrong, is there a way of sorting this out?

Help would be much appreciated.

Stickerman.
 

My Computer

System One

  • OS
    Windows 8.1
    Computer type
    Laptop
    System Manufacturer/Model
    Lenovo
I realize this is a little late so you may have already resolved this issue.

This sounds like a problem with where your .dat file is saved.
I'm guessing you have it saved in the same folder as your VB6 program (under C:\Program Files....)
The problem with doing this (since Windows Vista) is that Windows takes a virtual copy of the file and your VB6 program works with that. When you modify or delete the .dat file you aren't affecting the virtual copy which your application carries on using.

This is not an issue just with Visual Basic 6 (VB6) programming, it applies to any application.

How to fix this ? Ideally you would put your .dat file elsewhere. But this would mean modifying your VB6 app.

Switching off UAC (User Account Control) would also fix this, but it isn't necessarily a good idea to do this.

The 'phantom' virtual copy of the file will be saved somewhere like
“C:\Users\<username>\AppData\Local\VirtualStore\Program Files\myapp\myfile.dat”
(where myapp is your program name and myfile.dat is your .dat file and <username> is the user logon)

So you could copy your .dat file to here every time (and permanently delete the one under C:\Program Files...)

Another fix would be to have your VB6 application stored outside of C:\Program Files..., such as creating a new folder "C:\My applications".
 

My Computer

System One

  • OS
    Windows XP, 7 and 8.1
    Computer type
    PC/Desktop
Back
Top