Quantcast
Viewing all articles
Browse latest Browse all 15729

Current Recordset does not support updating. This may be a limitation of the provider

Hello Guys,

I am new here. I used to code for VB6, but due to company request I tried VBA in Excel. I am working on a macro and I encountered this error:

Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype

Been trying to find a solution to my problem since most of the people experienced this error already, but i can't seem to find the best solution for me. Already deployed the macro in our company local folder, some of the users can access the macro smoothly and they don't experience any errors at all. But some users experience this error when they try to login in the macro. I am not sure if this is due to the folder restriction, but after updating the folder's permission, some of the few users still experience the error. I am trying to find a solution to fix this since base on my research, the cause of error is something about read-only on the code or something and I am not sure what to do anymore and I'm running out of ideas.

Please see below for my code in the login form:

Code:

DB.Open Connection
RS.Open "SELECT * FROM tblUsers WHERE Username ='" & txtUsername.Text & "' AND Password ='" & txtPassword.Text & "'", DB, 3, 3
    While RS.EOF <> True
   
    If txtUsername.Text = RS("Username") And txtPassword.Text = RS("Password") Then
            curusertype = RS(2)

    'If the user who logged in as an Admin
   
    If RS(3) = "Admin" Then


            MsgBox "Successfully Logged in as Administrator.  ", vbInformation
            addUserActions "LOGGED IN TO SYSTEM", "USER LOG"

            frmMainMenu.lblUser.Caption = RS(1) 'Username
            frmMainMenu.lblUserLevel.Caption = RS(3) 'User level
            frmMainMenu.lblTeam.Caption = RS(13) 'Team
           
            frmMainMenu.frameViewUsers.Visible = True
            frmMainMenu.frameMyProfile.Visible = False
            frmMainMenu.cboSelect.Text = "View Users"
           
            RS.Close
            DB.Close
            Set RS = Nothing
           
            Unload Me
            frmMainMenu.Show
           
           
    ElseIf RS(3) = "Team Lead" Then


            MsgBox "Successfully Logged in as Team Lead.  ", vbInformation
            addUserActions "LOGGED IN TO SYSTEM", "USER LOG"

            frmMainMenu.lblUser.Caption = RS(1) 'Username
            frmMainMenu.lblUserLevel.Caption = RS(3) 'User level
            frmMainMenu.lblTeam.Caption = RS(13) 'Team
           
            frmMainMenu.frameViewUsers.Visible = False
            frmMainMenu.frameMyProfile.Visible = True
           
            RS.Close
            DB.Close
            Set RS = Nothing
           
            Unload Me
            frmMainMenu.Show
           
                 
    ElseIf RS(3) = "User" Then


            MsgBox "Successfully Logged in as User.  ", vbInformation
            addUserActions "LOGGED IN TO SYSTEM", "USER LOG"
           
            frmMainMenu.lblUser.Caption = RS(1) 'Username
            frmMainMenu.lblUserLevel.Caption = RS(3) 'User level
            frmMainMenu.lblTeam.Caption = RS(13) 'Team
           
            frmMainMenu.frameViewUsers.Visible = False
            frmMainMenu.frameMyProfile.Visible = True
           
            RS.Close
            DB.Close
            Set RS = Nothing
           
            frmMainMenu.Show
            Unload Me
    End If
           
            Unload Me
    End
    End If
    RS.MoveNext
    Wend
RS.Close
DB.Close


   
MsgBox "Access Denied: Incorrect Password or Account does not Exist.", vbCritical
txtUsername.Text = ""
txtPassword.Text = ""
txtUsername.SetFocus

And this is for my connection (I used a module):

Code:

Public Function Connection()
   
    Connection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ThisWorkbook.Path & "\dbSterlingTallyNewMeta.ACCDB;Persist Security Info=False"
   
End Function

Please I badly needed help. I can't even debug to find where the error is starting since I don't experience the error. Few users telling me that they experience this error. Thank you so much and more power!

Viewing all articles
Browse latest Browse all 15729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>