views:

66

answers:

2

Hi

I'm working with a program that accesses an MS-Access DB. The problem is that if I open the db file with Access, the values I see aren't the values I see when I'm using the program. For example, There is a table PARAMS with various program variables, one of them is the date I last loaded a certain file. In access it reads April 12th 2010, while in the program it reads May 7th 2010 (this is correct).

April 12th is about the time I upgraded the computer to Windows 7. Also, the mdb file sits next to the program executable in C:\Program Files (x86); and I know that Win7 doesn't allow programs to write to the program files dir. So where are the changes saved?

What I've tried: I've tried opening the mdb file on another computer - still reads the wrong (old) values I've tried copying the entire program dir to a different folder - now both the program and ms-access read the wrong values.

Can someone tell me how to get a version of the DB with all the values up to date with the program?

Thanks.

+3  A: 

Are you putting the database in the application folder? If so, you are probably experiencing UAC Virtualization (AKA Data Redirection).

"For example, if an application attempts to write to C:\Program Files\Contoso\Settings.ini, and the user does not have permissions to write to that directory (the Program Files), the write operation will be redirected to C:\Users\Username\AppData\Local\VirtualStore\Program Files\Contoso\settings.ini"

The database should be stored in the %APPDATA% folder instead.

http://windowsteamblog.com/blogs/developers/archive/2009/08/04/user-account-control-data-redirection.aspx

http://support.microsoft.com/kb/927387

Kelly
I completely agree, but I didn't write the program and can't change it. All I want is to get an updated version of the DB.Where is the data redirected to?
ytoledano
Thanks, I found it:C:\Users\<USER>\AppData\Local\VirtualStore\<PROGRAM DIR>It contains an updated version of the DB
ytoledano
ytoledano If you didn't write the program then the person who has responsibility for the program hasn't followed Microsoft guidelines since at least Wnidows NT 4.0. This is DOS behavior.
Tony Toews
no upvote/mark as answer for helping you out?
Kelly
I accepted this answer, didn't I?
ytoledano
yup its accepted now, thanks.
Kelly
A: 

When you are looking at Program Files in a Windows Explorer, look for a button along with Organize, Open, Print, Burn etc that says Compatibility Files. That in general will take you to the virtualization location for a folder.

Also, if you are willing to put up with the UAC prompt, if you run the application as an administrator it will write to the location under program files. Or if you move your installation to somewhere other than program files, though this would cause you to lose protection against someone changing the exe, it will write to the application directory also.

Kate Gregory