I am currently working within Access 2013. I am building a database for a small group of people, in which the database will be in a shared folder (split database). The problem that I am having with the database is that, I can login successfully through the login screen, but when someone else tries to login they will get "Run-time error '3051': The Microsoft Jet database engine cannot open the file 'xxx.mdb'. It is already opened exclusively by another user, or you need permission to view its data". Also, when they bypass the login in screen by going to design view (a function only used for testing), they cannot open a table.
My code:
Option Compare Database
Option Explicit
Private Sub btnLogin_Click()
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("tblUser", dbOpenSnapshot, dbReadOnly)
rs.FindFirst "UserName='" & Me.txtUserName & "'"
If rs.NoMatch = True Then
Me.lblWrongUser.Visible = True
Me.txtUserName.SetFocus
Exit Sub
End If
Me.lblWrongUser.Visible = False
If rs!Password <> Nz(Me.txtPassword, "") Then
Me.lblWrongPass.Visible = True
Me.txtPassword.SetFocus
Exit Sub
End If
Me.lblWrongPass.Visible = False
DoCmd.OpenForm "frmPersonal Information"
DoCmd.Close acForm, Me.Name
End Sub
When running the debug it is showing that something is wrong with:
Set rs = CurrentDb.OpenRecordset("tblUser", dbOpenSnapshot, dbReadOnly)
Is there anything that I am doing wrong or do I need to split the database and turn the front end into a ACCDE file?