UI am trying to create a job in SQL Server whcih runs a VB Script file. We have created an ASP file and run it on IIS, and all works fine. When I put it into MS SQL Server 7 under jobs, I get the error &#039;14277: The command script does not destroy all the objects that is creates. Revise the command script. The job was not saved.&#039;<BR><BR>Now I have set all the ADODB.Command, and ADODB.Recordset = Nothing at the end of the script. I have broken down the script and some of it works with the database connections! Please help:<BR><BR>Any answers, could u please e-mail to me at gunja99@hotmail.com<BR><BR>Thanks,<BR> Martin<BR><BR>Code:<BR>=========================== =============================<BR><BR>OPTION EXPLICIT<BR><BR>&#039; make up some constants<BR>Const adCmdStoredProc = &H0004<BR>Const adChar = 129<BR>Const adParamInput = &H0001<BR>Const adOpenForwardOnly = 0<BR>Const adInteger = 3<BR>Const adExecuteNoRecords = &H00000080<BR><BR>&#039; make up some variables<BR>dim dbCommand, rsObjImage, strconn, lang<BR>dim intIsActiveID, intIsActive, intNextActiveID, breakLoop<BR>dim firstID, gotFirstValue<BR><BR>strconn = "filedsn=locartis" <BR>set dbCommand = Server.createObject("adodb.command")<BR>set rsObjImage = Server.createObject("adodb.recordset")<BR><BR>With dbCommand<BR> .activeConnection = strConn<BR> .commandText = "sp_getAllRolloverImages"<BR> .commandType = adCmdStoredProc<BR>End With<BR>rsObjImage.open dbCommand,,adOpenForwardOnly<BR><BR><BR><BR>breakL oop = False<BR>gotFirstValue = False<BR><BR> do while not rsObjImage.EOF and not breakLoop<BR> &#039; get whether the image is active<BR> intIsActive = rsObjImage.fields("blnActive")<BR><BR> &#039; get the 1st value in the loop so that it can be referenced later<BR> if gotFirstValue = False then<BR> firstID = rsObjImage.fields("idRolloverImage")<BR> gotFirstValue = True<BR> end if<BR><BR> &#039; if it is active then get the id of that image<BR> if intIsActive = True then<BR> intIsActiveID = rsObjImage.fields("idRolloverImage")<BR> end if<BR> <BR> &#039; move to the next object<BR> rsObjImage.moveNext<BR><BR> &#039; if at the end of file and the active has JUST been set...<BR> &#039; ... then the active one is no. 1 else it is the next one<BR> if intIsActive = True then<BR> if rsObjImage.EOF then<BR> intNextActiveID = firstID<BR> else<BR> intNextActiveID = rsObjImage.fields("idRolloverImage")<BR> end if<BR> breakLoop = True<BR> end if<BR><BR> loop<BR><BR>Set dbCommand = Nothing<BR>Set rsobjImage = Nothing<BR>&#039; Set the next one with ID = intNextActiveID to active (1)<BR>Set dbCommand = Server.createObject("adodb.command")<BR>Set rsobjImage = Server.CreateObject("ADODB.Recordset")<BR><BR>With dbCommand<BR> .activeConnection = strConn<BR> .commandText = "sp_updateRolloverSetActive"<BR> .commandType = adCmdStoredProc<BR> .Parameters.Append .CreateParameter("@rolloverID", adInteger, adParamInput, , intNextActiveID)<BR> &#039; .Execute ,, adExecuteNoRecords<BR>End With<BR><BR>rsobjImage.Open dbCommand, , adOpenForwardOnly<BR><BR>Set dbCommand = Nothing<BR>Set rsobjImage = Nothing<BR>&#039; Set the current one with ID = intIsActiveID to inactive (0)<BR>set dbCommand = Server.createObject("adodb.command")<BR>With dbCommand<BR> .activeConnection = strConn<BR> .commandText = "sp_updateRolloverSetInActive"<BR> .commandType = adCmdStoredProc<BR> .Parameters.Append .CreateParameter("@rolloverID", adInteger, adParamInput, , intIsActiveID)<BR> .Execute ,, adExecuteNoRecords<BR>End With<BR><BR><BR>&#039; clean up all variables<BR>set dbCommand = nothing<BR>set rsObjImage = nothing<BR><BR>=================================== ===========================