Hello,
I am concerned about the possibility that my application may be leaking memory. In the code below I added the line to set AppAccess = Nothing. Then I started to test. I open the task manager and check the memory used by Excel, then step through the program. After the program runs, the memory used gets larger and larger. Could anyone offer any suggestions. I would like to 1) stop any leaks, and 2) possibly empty memory via vba after Access is closed.
Thank you for all of your help,
Pat
Sub test2222()
accessrunner_no_string "C:\Documents and Settings\pd\My Documents\ZZZ_BIN", "Database61.mdb", "data_import_test"
End Sub
Sub accessrunner_no_string(pathname1 As String, dbsname1, modulename1)
'Application.Interactive = False
'Application.DisplayAlerts = False
'This is all access communication programming
Dim appAccess As Access.Application
Dim strDB As String
' Initialize string to database path.
strConPathToSamples = pathname1
strDB = strConPathToSamples & "\" & dbsname1
' Create new instance of Microsoft Access.
Set appAccess = _
CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.OpenCurrentDatabase strDB, True
appAccess.Visible = True
'end of access communication setup
appAccess.Run modulename1
appAccess.Quit
Set appAccess = Nothing
Application.Interactive = True
Application.DisplayAlerts = True
End Sub
I am concerned about the possibility that my application may be leaking memory. In the code below I added the line to set AppAccess = Nothing. Then I started to test. I open the task manager and check the memory used by Excel, then step through the program. After the program runs, the memory used gets larger and larger. Could anyone offer any suggestions. I would like to 1) stop any leaks, and 2) possibly empty memory via vba after Access is closed.
Thank you for all of your help,
Pat
Sub test2222()
accessrunner_no_string "C:\Documents and Settings\pd\My Documents\ZZZ_BIN", "Database61.mdb", "data_import_test"
End Sub
Sub accessrunner_no_string(pathname1 As String, dbsname1, modulename1)
'Application.Interactive = False
'Application.DisplayAlerts = False
'This is all access communication programming
Dim appAccess As Access.Application
Dim strDB As String
' Initialize string to database path.
strConPathToSamples = pathname1
strDB = strConPathToSamples & "\" & dbsname1
' Create new instance of Microsoft Access.
Set appAccess = _
CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.OpenCurrentDatabase strDB, True
appAccess.Visible = True
'end of access communication setup
appAccess.Run modulename1
appAccess.Quit
Set appAccess = Nothing
Application.Interactive = True
Application.DisplayAlerts = True
End Sub