Hiya,
trying to connect to an access db that is password protected. I get a runtime error that says "Cannot start your application. The workgroup information file is missing or opened exclusively by another user"
The db in question is not open and the workgroup file is not missing, it's where it belongs in Windows\System32\System.mdw
Can anyone help me overcome this, as I want to keep my end user out of the database if possible. I have a feeling it is because I'm not specifying which user to connect as, but I don't know how to do that. Some of my code:
Can anyone assist?
trying to connect to an access db that is password protected. I get a runtime error that says "Cannot start your application. The workgroup information file is missing or opened exclusively by another user"
The db in question is not open and the workgroup file is not missing, it's where it belongs in Windows\System32\System.mdw
Can anyone help me overcome this, as I want to keep my end user out of the database if possible. I have a feeling it is because I'm not specifying which user to connect as, but I don't know how to do that. Some of my code:
Code:
Public Sub PopulateListBox(mdb As String)
Dim con As ADODB.Connection
Dim thisSQL As String
Dim ConnectionString As String
Dim rs As ADODB.Recordset
Set con = New ADODB.Connection
On Error GoTo BackOut
'Get the connection
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mdb
con.Open ConnectionString, , "1811"
con.BeginTrans
'Execute query to return as resultset
Set rs = con.Execute("SELECT DISTINCT DistID FROM qry_Output")
rs.MoveFirst
Do While Not rs.EOF
UserForm1.UltimateListBox.AddItem rs.Fields("DistID")
rs.MoveNext
Loop
con.CommitTrans
con.Close
Exit Sub
Backout:
etc etc