I am facing a problem in a program. I am using VB 2008 on a 64 bit Win 7 OS. The program calculates the hash of certain windows processes and then stores them in an Access database (2003 .mdb type).
Now the problem that occurs is that to access the database I make changes as
Project (right click) -> Properties -> Compile -> Advanced Compile Options -> Target CPU to x86
But when i use this setting the program throws a file not found exception when it tries the access the windows/system32 folder.
So to access the windows/system32 folder i have to use the settings as :
Project (right click) -> Properties -> Compile -> Advanced Compile Options -> Target CPU to x64
but on using this setting i cannot access the database.
Asked
Active
Viewed 84 times
-1

arya
- 33
- 2
- 8
-
So your database is in the Windows/System32 directory? Why is that? – Nico Schertler Mar 06 '12 at 09:20
-
see http://stackoverflow.com/questions/2147737/changing-a-visual-studio-c-sharp-project-from-x86-to-any-cpu also check http://stackoverflow.com/questions/3640820/system32-folder-in-windows-7 hope this will help you. – MANISHDAN LANGA Mar 06 '12 at 09:21
-
no my database is not in Win/system32 directory. the hash function calculates the hash of certain processes in system32 directory.. – arya Mar 06 '12 at 09:27
1 Answers
2
You'll need to move your database file to c:\windows\syswow64.
This is of course not a good idea at all, these directories are owned by Windows. File system redirection on a 64-bit operating system is the kind of accident waiting to happen. Security permission problems are next. Use the AppData folder instead, Environment.GetFolderPath() to find it.

Hans Passant
- 922,412
- 146
- 1,693
- 2,536
-
i solved this problem actually. Instead of pointing to system32 folder in my program i had to use the sysnative folder. Now both the modules work fine in x86 platform. thnx people – arya Mar 07 '12 at 14:05
-
1
-
I am working on windows 7 and this problem would never occur with Win XP i think... – arya Mar 08 '12 at 08:23