Solved

I get an error message when connecting to an access database

Posted on 2016-07-18
3
79 Views
Last Modified: 2016-08-02
In vb.net, 2015- when I connect to an access database, with the following code:

Dim StnStr() As String
        StnStr = "Data Source=servername; Initial Catalog=databasename; User ID=userid; Password=password"
        StnStr = "Provider=MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;"
        StnStr = StnStr & "Jet OLEDB:System database=" & My.Application.Info.DirectoryPath & "\System.mdw;"
        StnStr = StnStr & "Password=PW;User ID=USERNAME;"
        StnStr = StnStr & "Data Source=" & My.Application.Info.DirectoryPath & "\data.mdb;"
        StnStr = StnStr & "Persist Security Info=False"

 Dim CON As New OleDb.OleDbConnection(StnStr)
       CON.Open()


I receive the following error message in the output window:

The program '[3660] UpdateCrgs.vshost.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
What can this mean?
In other projects it seems fine, why in this project am I getting this message?
0
Comment
Question by:Moshe Singer
  • 2
3 Comments
 
LVL 26

Expert Comment

by:Nick67
ID: 41717672
I'm a thinkin' this is a little hatched

StnStr = "Provider=MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;"
https://msdn.microsoft.com/en-us/library/ms254500(v=vs.110).aspx

Are you sure that the MSDataShape provider is in use with an .mdb data source?
And are you sure you want to carry on with that, as it seems that MS is deprecating it?
https://msdn.microsoft.com/en-us/library/ms676105(v=vs.85).aspx
0
 

Author Comment

by:Moshe Singer
ID: 41717804
I have the same situation if I use
Provider=Microsoft.Jet.OLEDB.4.0;
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
ID: 41717830
Perhaps it isn't MS Access violation!

Perhaps it is 'access violation' as in you don't have appropriate NTFS security on the file
Or something else that is causing a memory access violation.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now