[Libreoffice-bugs] [Bug 121342] Access2Base Counter for OpenRecordset usage is too low

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sun Nov 11 04:13:08 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=121342

--- Comment #3 from tsultana <tony.sultana at pm.me> ---
I mentioned using CurrentDb().CloseAllRecordsets() to reset the RecordsetMax =
0 but that does not work. Since I close each Recordset the Collection is empty
so the routine exits without resetting the RecordsetMax variable. Below is the
code for the CurrentDb().CloseAllRecordsets() subroutine which exits at the If
IsNull() line.

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
For i = 1 To RecordsetsColl.Count
Set oRecordset = RecordsetsColl.Item(i)
oRecordset.mClose(False) ' Do not remove entry in collection
Next i
Set RecordsetsColl = New Collection
RecordsetMax = 0

Exit_Sub:
Exit Sub
End Sub ' CloseAllRecordsets V0.9.5

Changing the first two If statements to reset the RecordsetMax = 0 would fix
the issue but may have other side effects that I am not aware of.
If IsNull(RecordsetsColl) Then
RecordsetMax = 0
Exit Sub
End If
If RecordsetsColl.Count < 1 Then
RecordsetMax = 0
Exit Sub
End If

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20181111/c60518bd/attachment.html>


More information about the Libreoffice-bugs mailing list