I have a function that I put some MsgBox in it trying to trap an "Out of stack space" error
Now it will constantly show the "_fnGetDbVersion - 1" MsgBox
what can cause this situation
there is sure no loop in the code. nor in the code calling this function
this is the code calling the function
*** EDIT ***
After this MsgBox (I click OK) it show it again.... and again.... and again ....
The code is get stuck showing the same MsgBox (Won't show _2_
Code:
Public Function fnGetDbVersion(strFileName, strFilePassword) As String
On Error GoTo errHere
fnGetDbVersion = 0
MsgBox "_fnGetDbVersion - 1"
Set DataDB = OpenDatabase(strFileName, False, False, "MS Access; PWD=" & strFilePassword & "")
MsgBox "_fnGetDbVersion - 2"
strSQL = "SELECT * " & _
"FROM [dbVersions] " & _
"ORDER BY [dbVersion] DESC "
MsgBox "_fnGetDbVersion - 3"
Set rs = DataDB.OpenRecordset(strSQL)
MsgBox "_fnGetDbVersion - 4"
With rs
If .RecordCount > 0 Then
.MoveFirst
fnGetDbVersion = .Fields("dbVersion")
.Close
Else
fnGetDbVersion = 0
End If
End With
MsgBox "_fnGetDbVersion - 5"
ExitHere:
Set rs = Nothing
Set DataDB = Nothing
Exit Function
errHere:
fnGetDbVersion = 0
Call ErrorHandling("mdl_Mithazim_GetFunctions", "fnGetDbVersion", Err, Err.Description)
Call pbCleanAfterError
Resume ExitHere
End Function
Now it will constantly show the "_fnGetDbVersion - 1" MsgBox
what can cause this situation
there is sure no loop in the code. nor in the code calling this function
this is the code calling the function
Code:
sngDataMDBVersion = fnGetDbVersion(pbDataPath & "\" & pbDataFileName, pbDataFilePass)
*** EDIT ***
After this MsgBox (I click OK) it show it again.... and again.... and again ....
The code is get stuck showing the same MsgBox (Won't show _2_
Last edited: