OleDb.OleDBException

  • 12 years ago

    When I try to run my program to connect to a database I get the following error:

    "Cannot start your application. The workgroup information file is missing or opened exclusively by another user."

    Imports System.Data.OleDb
    Imports System.Data
    Public Class Form1
        Inherits System.Windows.Forms.Form
        'make an object so we can open a database connection
        Private AdaraConnection As OleDbConnection = New OleDbConnection
        'make an object that sends commands from VB to Access DB.
        Private AdaraDataAdapter As OleDbDataAdapter = New OleDbDataAdapter
        'define dataset
        Private AdaraDataSet As DataSet = New DataSet
        'make datatable
        Private AdaraDataTable As DataTable
        'select command
        Private OleDBSelectCommand As OleDbCommand = New OleDbCommand
    
    
        Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
            'make sure we update the database before the program closes
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'FILL DATASET WITH ALL THE TABLES
            AdaraConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password=""m1p2m3o4w5"";User ID=Admin;Data Source= GameData.mdb"
            AdaraConnection.Open() <-------ERROR HAPPENS HERE
            AdaraDataTable = AdaraDataSet.Tables(0)
            AdaraDataAdapter.Fill(AdaraDataSet)
            'OleDBSelectCommand.CommandText = "SELECT * FROM Player"
        End Sub
    End Class
    

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Engineers are all basically high-functioning autistics who have no idea how normal people do stuff.” - Cory Doctorow