out of memory runtime error... some suggestions?
hello,
i've sent a program to a friend to test out for me, but he gets a run time error 7 (out of memory) when he clicks on 2 certain things....
i've gone through the code where the error occurs with no luck, so i was hoping maybe someone could see if they can find some error that would cause such a memory leak... works just peachy for me, but not for him... and it ALWAYS happens for him , even after reboot, etc... so it must be my code :(
here's the code when the button is clicked:
VB Code:
If Not IsConnection Then
Call CreateConnection(DBCONNECTIONS)
End If
WebBrowse.Visible = False
Call UnloadSubForms
Load frmBrowse
SetParent frmBrowse.hWnd, fraMain.hWnd
frmBrowse.Show
here's the public functions i made that are called:
VB Code:
'sub to close a global connection
Public Function CloseConnection()
If objConn Is Nothing Then
'is nothing
Else
objConn.Close
Set objConn = Nothing
End If
End Function
'sub to see if connection exists
Public Function IsConnection()
If objConn Is Nothing Then
IsConnection = False
Else
IsConnection = True
End If
End Function
...
last but not least, here's the code on the form's load that is loaded ...
VB Code:
'delcare variables
Dim objRS As New ADODB.Recordset
'disenable view button
cmdView.Enabled = False
'open recordset
Set objRS = New ADODB.Recordset
objRS.Open "SELECT program FROM programs ORDER by program", objConn, 1, 3
'loop through recordset
Do Until objRS.EOF
'add program name to list
cmbProgram.AddItem objRS("program")
objRS.MoveNext
Loop
'close recordset
objRS.Close
Set objRS = Nothing
now, when he clicks on another button that also uses the set parent function, it works fine, so im assuming that function has nothing to do with my problem......
appreciate the help!