Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
squarefish
Starting Member
28 Posts |
Posted - 2010-08-16 : 06:18:53
|
The code below works fine as a vbs file, but when I try and use it as an active x script within sql2005 I get the above error saying not all the objects were destroyed???as far as I can see all my set something = have a set something = nothing?Any ideas?[CODE]option explicitdim MM_stock_STRING, MM_CAP_STRING, MM_CAP2_STRING, rs, regplate, capid, rsCap, sql, manufacturerdim range, derivative, fueldelivery, drivetrain, transmission, doors, bodystyle, optionActualdim MM_editCmd, rsCap2'get all cars with a cap idset rs = CreateObject("ADODB.Recordset")rs.ActiveConnection = MM_stock_STRINGrs.Source = mysqlrs.CursorType = 2rs.CursorLocation = 2rs.LockType = 1rs.Open()'Loop through the carsdo until rs.EOF set rsCAP = CreateObject("ADODB.Recordset") rsCAP.ActiveConnection = MM_CAP_STRING sql = mysql rsCAP.Source = sql rsCAP.CursorType = 2 rsCAP.CursorLocation = 2 rsCAP.LockType = 1 rsCAP.Open() if not rsCAP.EOF then 'write results back to db Set MM_editCmd = CreateObject("ADODB.Command") sql = mysql MM_editCmd.ActiveConnection = MM_stock_STRING MM_editCmd.CommandText = sql MM_editCmd.Execute MM_editCmd.ActiveConnection.Close Set MM_editCmd = NOTHING 'reset optionActual optionActual="" else set rsCAP2 = CreateObject("ADODB.Recordset") rsCAP2.ActiveConnection = MM_CAP2_STRING sql = sql rsCAP2.Source = sql rsCAP2.CursorType = 2 rsCAP2.CursorLocation = 2 rsCAP2.LockType = 1 rsCAP2.Open() 'loop through the optionActual and append to string if not rsCAP2.EOF then 'write results back to car Set MM_editCmd = CreateObject("ADODB.Command") sql = mysql MM_editCmd.ActiveConnection = MM_stock_STRING MM_editCmd.CommandText = sql MM_editCmd.Execute MM_editCmd.ActiveConnection.Close Set MM_editCmd = Nothing optionActual="" else 'delete and alert Set MM_editCmd = CreateObject("ADODB.Command") sql = mysql MM_editCmd.ActiveConnection = MM_stock_STRING MM_editCmd.CommandText = sql MM_editCmd.Execute MM_editCmd.ActiveConnection.Close Set MM_editCmd = Nothing end if rsCAP2.Close() SET rsCAP2 = Nothing end if rsCAP.Close() SET rsCAP = Nothing rs.MoveNextLooprs.Closeset rs=nothing[/CODE] |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-08-16 : 10:15:20
|
http://connect.microsoft.com/SQLServer/feedback/details/284448/the-command-script-does-not-destroy-all-the-objects-that-it-creates-revise-the-command-script-error-14277 |
|
|
|
|
|
|
|