Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

Earlier ms access 2013 version was installed on machine. Now, ms access 2016 version has been installed.

I didn't make any changes in code, but i am getting "a first chance exception of type 'system.accessviolationexception' occurred" error.


I am using Microsoft Visual Studio Professional 2013 with vb.net code and ms access 2016 version.

Kindly suggest you ideas in vb.net.

Thanks & Regards,
Saurav Sinha

What I have tried:

I have change something with properties but didn't work. Also, tried below steps -

Tools menu ->Options -> Debugging -> General -> Uncheck this option "Suppress JIT optimization on module load"

not working for me.
Posted
Updated 20-Sep-18 19:54pm

1 solution

You get an "Access violation" error when the process trying to open a file does not have sufficient permissions for it. So start by looking at the file you are opening, the folder that contains it, and see exactly where it is, and what users have access rights. It's possible that Access 2016 uses a service which runs under a different user that the 2013 version didn't and so the file is not available.

If the file is under a User account ("My Documents" for example) then it may only be available to your specific user. Or it may be in your application folder, which is always a stupid idea! :laugh:
Try moving the DB to a new folder which has specifically been given all user all access and see if that improves things. This may help: Where should I store my data?[^]
 
Share this answer
 
Comments
yash1507 21-Sep-18 2:25am    
Thanks OriginalGriff for your suggestions.

It's not working for me. I have kept that file in admin account and confirmed that the user have admin rights.

Below is the error message -
A first chance exception of type 'System.AccessViolationException' occurred in exe.
Additional information: Attempted to read or write protected memory. This is often and indication that other memory is corrupt.

i think somewhere ms access 2016 is not allowing the vb.net program to read/write. I didn't make any changes with the code, but it was working fine with ms access 2013.

Can anybody suggests some more ideas.



Thanks & Regards,
Saurav Sinha
OriginalGriff 21-Sep-18 3:17am    
That's different - it has nothing to do with a file.
In future, give us the whole error message: "Attempted to read or write protected memory. This is often and indication that other memory is corrupt." is important - it means that how you are calling something is wrong, not the file you are using.
At a guess, it's bad parameters, but the only way to find out is to use the debugger to find out exactly which line of your code it's complaining about, and look at exactly what you are passing as data to what.
We can't do that for you - you need to use the debugger on running code!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900