Wrox Programmer Forums
BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9
This is the forum to discuss the Wrox book Professional SQL Server 2005 Integration Services by Brian Knight, Allan Mitchell, Darren Green, Douglas Hinson, Kathi Kellenberger, Andy Leonard, Erik Veerman, Jason Gerard, Haidong Ji, Mike Murphy; ISBN: 9780764584350
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 6th, 2009, 11:03 AM
Registered User
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chap. 12; Error in GetServiceInfo package ... help

Hi, when I try to execute the GetServiceInfo package I received an error. Can anybody help?

I execute the package in the DTS designer (SQLServer Enterprice Manager), and get the following error "ActiveX Scripting encountered a Run Time Error during the execution of the script."

I don't know if my server has "winmgmts" installed - can I check that.

This is my script:
'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Option Explicit
Function Main()

Dim strLocalFolderName, strOutputFileName, strComputer
Dim objFSO, objWMIService, objMyFile, colServiceList, objService
strLocalFolderName = "C:\SSIS"
strOutputFileName = strLocalFolderName & "\ServiceAndStartMode.csv"
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonat e} !\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery("Select * From win32_Service")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If (objFSO.FileExitsts(strOutputFileName)) then
objFSO.DeleteFile (strOutputFileName)
End If
Set objMyFile = objFSO.CreateTextFile(strOutputFileName, true)
objMyFile.Writeline ("ServiceName, StartMode")
For each objService In colServiceList
objMyFile.Writeline ( objService.DisplayName & ", " & objService.Startmode)
Set objFSO = Nothing
Set objWMIService = Nothing
Set objMyFile = Nothing
Set colServiceList = Nothing
Set objService = Nothing
Main = DTSTaskExecResult_Success
End Function

Similar Threads
Thread Thread Starter Forum Replies Last Post
chap 12 exer 2 harper BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1 0 January 31st, 2008 10:19 AM
Chap 12 connection to a dbase jardbf BOOK: Beginning ASP 3.0 1 May 25th, 2006 11:01 AM
chap. 12 -cmstables.php niy BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 January 12th, 2005 02:36 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.