Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a memory leak. Please Help 1

Status
Not open for further replies.

jmgrin

MIS
Jan 4, 2002
32
US
I am experiencing what appears to be a memory leak in several of my VB 6.0 applications. To try to identify the problem, I've created a new application, inserted the Beginning form from one of the applications I'm having a problem with. The form has 5 command buttons. Here is the code from the form:



Global dbclass As New ADODB.Connection<--This is defined in a
module called main. It is the only
thing in the module


Private Sub Form_Load()
MakeConnection
End Sub

Private Sub Form_Unload(Cancel As Integer)
CloseConnection
End Sub
Private Sub cmdAction_Click(Index As Integer)
Dim MenuOption As String
frmDERMenu.Hide
Select Case Index
Case 0
MenuOption = &quot;STDT&quot;
Case 1
MenuOption = &quot;JOBC&quot;
Case 2
MenuOption = &quot;FREQ&quot;
Case 3 'Exit
Case 4 'Create QUALS file
MenuOption = &quot;QUAL&quot;

End Select

Unload frmDERMenu
End Sub

Sub MakeConnection()

Set dbclass = New ADODB.Connection

'Create the connection.
dbclass.ConnectionString = &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; _
& &quot;Data Source = &quot; & App.Path & &quot;\DER.mdb&quot;
dbclass.Open
End Sub
Sub CloseConnection()
dbclass.Close
Set dbclass = Nothing
End Sub


I have the program compiled to a .exe file.
What is happening is I execute the program and display the form and then immediately exit. Then if I wait 1/2 hour to an Hour, and try again to execute the program I get the error:

(myprogram0.exe - Application Error. The instruction at 0x77fab813 referenced memory at 0x00000058. The memory could not be read.


Does anyone see any problem with this code or know of an existing problem with the data access driver?

Thanks for any help you can give me.
 
When I rerun the application, I can't even get the menu to display.

The machines that are having problems don't have much software loaded... Microsoft Office, Visual Studio, Crystal Reports, SAS, Internet Explorer, Eudora. All software that is loaded on another machine that is not having a problem running the applications.
 
Ok then go to the machine and see what process are running on it and compare them with a machine that crashes. I really don't suspect your app at all.

Have you made the changes suggested above? If so does it still happen?


William
Software Engineer
ICQ No. 56047340
 
For anyone following this thread, the problem was being caused by the elkern virus. Thanks for all the responses
 
Hello,
I have this very same problem...I dont have the elkern virus either. Basically, I connect with ado to my database, after a couple movenext i exit, and it crashes on vb6.exe within the ntdll.dll

Anyone know what is going on here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top