computergeek
Programmer
Hi,
I am having trouble with the releasing of a VB Com object from memory. When I try to unregister & delete the dll file and replace with a newer version it says it's in use? Within the following piece of code I declare objForecast, and then release it from memory using "Set objForecast = Nothing". The recordset, connection, and command objects are declared as global type variables and are closed later in the script. Apparently, Inetinfo.exe is still accessing the object after I have closed the application??! (I looked via a 3rd party tool to see what had the COM open.) The only way to free the object from memory was through brute force by:
1. Stopping the Web server
2. issuing a number of net stop commands at the command prompt
For example: net stop w3svd
See Microsoft Q185382
3. Then starting up services again
------------------------------
Function GetForecastData()
Dim rows
Dim objForecast
'Create and open the Connection object (Connection string defined in Global.asa)
set adoConn = Server.CreateObject("ADODB.Connection"
adoConn.Open Application("Connection2_ConnectionString", _
Application("Connection2_RuntimeUserName", _
Application("Connection2_RuntimePassword"
' Create instance of ForecastAndResupply COM object (ForecastAndResupply.dll)
set objForecast = Server.CreateObject("ForecastAndResupply.ForecastGrid"
' Set input parameters for the ForecastAndResupply COM object
''objForecast.SiteID = 1;
''objForecast.StockID = 1;
objForecast.StockID = stockid_inputparam
objForecast.SiteID = siteid_inputparam
' Get the number of rows to be returned
rows = objForecast.FillArray()
' If data exists for current parameters continue retreiving data...
if (rows > 0 ) then
set cmTmp = Server.CreateObject("ADODB.Command"
cmTmp.ActiveConnection = adoConn
set rsForecast = objforecast.ThrowRecordset()
rsForecast.movefirst
end if
' Destroy Com object
Set objForecast = Nothing
' Return number of rows
GetForecastData = rows
end function
MY QUESTIONS:
1..WHY DOESN'T MY COM OBJECT GET FREED FROM MEMORY??
2. WHAT IS INETINFO.EXE?
Thanks,
Computergeek
I am having trouble with the releasing of a VB Com object from memory. When I try to unregister & delete the dll file and replace with a newer version it says it's in use? Within the following piece of code I declare objForecast, and then release it from memory using "Set objForecast = Nothing". The recordset, connection, and command objects are declared as global type variables and are closed later in the script. Apparently, Inetinfo.exe is still accessing the object after I have closed the application??! (I looked via a 3rd party tool to see what had the COM open.) The only way to free the object from memory was through brute force by:
1. Stopping the Web server
2. issuing a number of net stop commands at the command prompt
For example: net stop w3svd
See Microsoft Q185382
3. Then starting up services again
------------------------------
Function GetForecastData()
Dim rows
Dim objForecast
'Create and open the Connection object (Connection string defined in Global.asa)
set adoConn = Server.CreateObject("ADODB.Connection"
adoConn.Open Application("Connection2_ConnectionString", _
Application("Connection2_RuntimeUserName", _
Application("Connection2_RuntimePassword"
' Create instance of ForecastAndResupply COM object (ForecastAndResupply.dll)
set objForecast = Server.CreateObject("ForecastAndResupply.ForecastGrid"
' Set input parameters for the ForecastAndResupply COM object
''objForecast.SiteID = 1;
''objForecast.StockID = 1;
objForecast.StockID = stockid_inputparam
objForecast.SiteID = siteid_inputparam
' Get the number of rows to be returned
rows = objForecast.FillArray()
' If data exists for current parameters continue retreiving data...
if (rows > 0 ) then
set cmTmp = Server.CreateObject("ADODB.Command"
cmTmp.ActiveConnection = adoConn
set rsForecast = objforecast.ThrowRecordset()
rsForecast.movefirst
end if
' Destroy Com object
Set objForecast = Nothing
' Return number of rows
GetForecastData = rows
end function
MY QUESTIONS:
1..WHY DOESN'T MY COM OBJECT GET FREED FROM MEMORY??
2. WHAT IS INETINFO.EXE?
Thanks,
Computergeek