Results 1 to 3 of 3

Thread: out of memory runtime error... some suggestions?

  1. #1

    Thread Starter
    Fanatic Member Redth's Avatar
    Join Date
    May 2001
    Location
    Ontario, Canada
    Posts
    551

    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:
    1. If Not IsConnection Then
    2.         Call CreateConnection(DBCONNECTIONS)
    3.     End If
    4.     WebBrowse.Visible = False
    5.     Call UnloadSubForms
    6.     Load frmBrowse
    7.     SetParent frmBrowse.hWnd, fraMain.hWnd
    8.     frmBrowse.Show

    here's the public functions i made that are called:

    VB Code:
    1. 'sub to close a global connection
    2. Public Function CloseConnection()
    3. If objConn Is Nothing Then
    4.     'is nothing
    5. Else
    6.     objConn.Close
    7.     Set objConn = Nothing
    8. End If
    9. End Function
    10. 'sub to see if connection exists
    11. Public Function IsConnection()
    12. If objConn Is Nothing Then
    13.     IsConnection = False
    14. Else
    15.     IsConnection = True
    16. End If
    17. End Function

    ...

    last but not least, here's the code on the form's load that is loaded ...

    VB Code:
    1. 'delcare variables
    2. Dim objRS As New ADODB.Recordset
    3.  
    4. 'disenable view button
    5. cmdView.Enabled = False
    6.  
    7. 'open recordset
    8. Set objRS = New ADODB.Recordset
    9. objRS.Open "SELECT program FROM programs ORDER by program", objConn, 1, 3
    10. 'loop through recordset
    11. Do Until objRS.EOF
    12.     'add program name to list
    13.     cmbProgram.AddItem objRS("program")
    14.     objRS.MoveNext
    15. Loop
    16. 'close recordset
    17. objRS.Close
    18. 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!

  2. #2
    Frenzied Member Motoxpro's Avatar
    Join Date
    Sep 2001
    Location
    Spiro, OK
    Posts
    1,211
    maybe try free mem pro

  3. #3

    Thread Starter
    Fanatic Member Redth's Avatar
    Join Date
    May 2001
    Location
    Ontario, Canada
    Posts
    551
    well like i said, i have no problems with the program, but my friend does...... if it's not working after a nice fresh reboot with 384 mb ram, i think others might have problems as well..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width