Advertisement

05.15.2008 at 09:20AM PDT, ID: 23405800
[x]
Attachment Details

System.Security.SecurityException 'occurred in System.Data.dll error

Asked by eolshenske in Microsoft Access Database, Microsoft Visual Studio Express

I am trying to connect a VB project to an Access Database.  The Access Database is in use.  I seem to be able to connect when the database is not in use but then I lock out the operators that need the program that runs from the Access database.  I have verified that the Access database has "open mode is Shared and the preferred default record locking is none. My code is:

Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.OleDb.OleDbPermission
Imports System.Security
Imports System.Security.Permissions



Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim con As New OleDb.OleDbConnection
        Dim permission As OleDbPermission = New OleDbPermission(PermissionState.None)
        con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=\\Computer Name\c$\Program Files\Folder Name\AccessDBName.mdb"
        con.Open()
        Debug.WriteLine("A Connection to the Database is now open")
        con.Close()
        Debug.WriteLine("A Connection to the Database is now closed")
    End Sub
End Class

I really need help on this.  An associate of mine is able to connect to a similar database using VB6 at a different location.
Start Free Trial
[+][-]05.15.2008 at 10:30AM PDT, ID: 21576161

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 11:40AM PDT, ID: 21576792

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 08:11AM PDT, ID: 21583426

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 08:49AM PDT, ID: 21583822

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 12:14PM PDT, ID: 21600661

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Access Database, Microsoft Visual Studio Express
Sign Up Now!
Solution Provided By: stevbe
Participating Experts: 1
Solution Grade: B
 
 
[+][-]05.20.2008 at 10:23AM PDT, ID: 21608275

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 01:09PM PDT, ID: 21627125

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 01:44PM PDT, ID: 21681286

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906