<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Access2Base Counter for OpenRecordset usage is too low"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=121342#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Access2Base Counter for OpenRecordset usage is too low"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=121342">bug 121342</a>
              from <span class="vcard"><a class="email" href="mailto:tony.sultana@pm.me" title="tsultana <tony.sultana@pm.me>"> <span class="fn">tsultana</span></a>
</span></b>
        <pre>I installed the the Recordset to the /home/user/.config/libreoffice/4/user
folder and restarted LO Base.

The following code was tested before the patch to confirm the same overflow
error.  Running the same function after the patch crashes immediately after k =
32767 with the same error.

Sub test(v As Double)
        Dim rec As Object, k As Long 

        Do
                k = k + 1
                If k Mod 10000 = 0  or k Mod 32767 = 0 Then
                        If msgbox("k = " & k, 1) = 2 Then
                                Exit Do  
                        End If 
                End If 
                rec = CurrentDb().OpenRecordset("configurations")
                rec.mClose
        Loop 
        CurrentDb().CloseAllRecordsets()
End Sub

Stepping into CloseAllRecordsets() in Access2Base.Database the
RecordsetsColl.Count equals 0 and exits in the second If/Then below without
clearing the RecordsetMax variable which overflowed.

Public Sub CloseAllRecordsets()
'       Clean all recordsets for housekeeping

Dim sRecordsets() As String, i As Integer, oRecordset As Object
        On Local Error Goto Exit_Sub

        If IsNull(RecordsetsColl) Then Exit Sub
        If RecordsetsColl.Count < 1 Then Exit Sub</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>