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
Enter your message below
Sign in or Join us (it's free).