Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
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)
Next
objMyFile.Close
Set objFSO = Nothing
Set objWMIService = Nothing
Set objMyFile = Nothing
Set colServiceList = Nothing
Set objService = Nothing
Main = DTSTaskExecResult_Success
End Function
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12:01 PM
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



All times are GMT -4. The time now is 09:36 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.