diff options
author | Jean-Pierre Ledure <jp@ledure.be> | 2014-09-13 15:08:29 +0200 |
---|---|---|
committer | Jean-Pierre Ledure <jp@ledure.be> | 2014-09-13 15:17:14 +0200 |
commit | bc5cdd24136a0d62659a6fe1e3f14cc22ad0ff90 (patch) | |
tree | fcc4f2eb28a81983369b15d568a31a810ccbbf37 /wizards/source/access2base/Form.xba | |
parent | 2c3844a17574590150dbfdeb8750397a85182e75 (diff) |
Access2Base - Introduction of CloseConnection method
The invocation of CloseConnection has next effects:
All the recordsets related to a database linked to the current document are closed.
The database object(s) is(are) released.
Change-Id: I845b27acb8469c4dea0dc3bc20b912ab123d06cf
Diffstat (limited to 'wizards/source/access2base/Form.xba')
-rw-r--r-- | wizards/source/access2base/Form.xba | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/wizards/source/access2base/Form.xba b/wizards/source/access2base/Form.xba index a787dfec6257..37fc0d121168 100644 --- a/wizards/source/access2base/Form.xba +++ b/wizards/source/access2base/Form.xba @@ -51,6 +51,10 @@ End Sub ' Destructor REM ----------------------------------------------------------------------------------------------------------------------- Public Sub Dispose() +Dim ofForm As Object + If Not IsLoaded(True) Then + If Not IsNull(DatabaseForm) Then DatabaseForm.Dispose() + End If Call Class_Terminate() End Sub ' Explicit destructor @@ -138,12 +142,14 @@ Property Let Height(ByVal pvValue As Variant) End Property ' Height (set) REM ----------------------------------------------------------------------------------------------------------------------- -Function IsLoaded() As Boolean +Function IsLoaded(ByVal Optional pbForce As Boolean) As Boolean 'Return True if form open +'pbForce = True forbids bypass on value of _IsLoaded If _ErrorHandler() Then On Local Error Goto Error_Function Utils._SetCalledSub("Form.getIsLoaded") - If _IsLoaded Then ' For performance reasons, a form object, once detected as loaded, is presumed remaining loaded + If IsMissing(pbForce) Then pbForce = False + If ( Not pbForce ) And _IsLoaded Then ' For performance reasons, a form object, once detected as loaded, is presumed remaining loaded. Except if pbForce = True IsLoaded = True Goto Exit_Function End If @@ -320,6 +326,7 @@ Dim oDatabase As Object, oController As Object Set oController = oDatabase.Document.getFormDocuments.getByName(_Name) oController.close() + Dispose() mClose = True Exit_Function: |