Solved

I get an error message when connecting to an access database

Posted on 2016-07-18
3
129 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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 …

734 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