Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server DTS
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server DTS Discussion specific to Data Transformation Service with SQL Server. General SQL Server discussions should use the general SQL Server forum. Readers of the book Professional SQL Server 2000 DTS with questions specific to that book should post in that book forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server DTS 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
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 25th, 2004, 08:15 AM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error while invoking DTS using xp_cmdshell

Hi
The DTS package having activex script Createobject("Excel.application")
is failing when it is invoked using xp_cmdshel command.
is it because the DTS is running in server when we execut it using xp_cmdshel if so having the microsoft excel application getting installed in the server is the only solution?
Thanks
Joseph
  #2 (permalink)  
Old May 25th, 2004, 10:18 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

At what point is it failing? Check and make sure account has proper permission to execute xp_cmdshell.

  #3 (permalink)  
Old May 25th, 2004, 10:21 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You can not run excel on a machine that doesn't have Excel installed on it. So yes, the machine running the DTS package needs to have Excel installed.

That said, I can't imagine why a DTS package would need to open Excel.


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
  #4 (permalink)  
Old May 25th, 2004, 02:20 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

As I am not an expert on DTS I can††only offer my opinion on why anyone would create and excel file on a server or workstation that does not have excel installed.

This is how I use excel on a machine that does not have excel installed.††

Using the excel connection in DTS I create and excel file
CREATE TABLE `Daily_JobReports` (
`Job Name` VarChar (128) ,
`Job Description` LongText ,
`LastStatusDate` Long ,
`JobStatus` VarChar (11)††)

I connect to myserver and run a store procedure

Select distinct j.Name as "Job Name", j.description as "Job Description", h.run_date as LastStatusDate,
case h.run_status
when 0 then 'Failed'
when 1 then 'Successful'
when 3 then 'Cancelled'
when 4 then 'In Progress'
end as JobStatus
from sysJobHistory h, sysJobs j
where j.job_id = h.job_id and h.run_date =
(select max(hi.run_date) from sysJobHistory hi where h.job_id = hi.job_id)
order by 1

I then output the results of the select statement to the excel file.
Then I ran an active x scripts to attach the excel file to an email and send to a user the "Daily Backup Job Reports"
'************************************************* *********************
'††Visual Basic ActiveX Script
'************************************************* ***********************

Function Main()
Dim iMsg

set iMsg = CreateObject("CDO.Message")

Dim objMail
Set objMail = CreateObject("CDO.Message")

objMail.From = "someaccount@somewhere.comt"
objMail.To = "you@somewhere.com,someonelese@somewhere.com"
objMail.AddAttachment "\\myservername\D$\jobreports\daily_jobreports.xls ")
objMail.Subject="Daily Backup Reports"
objMail.TextBody = "These are your Daily Backup Reports"
objMail.Send
Set objMail = nothing

Main = DTSTaskExecResult_Success
End Function

What all this does is send and excel reports to a user that wants to make sure that his database is being backed up and maintain everyday.††So I schedule this DTS Package to run everyday.††I even though I do not have excel on my server I am able to create an excel file for others to use.
  #5 (permalink)  
Old May 25th, 2004, 02:36 PM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Your not running Excel ... Your creating an Excel compliant file.. THe original poster wants to run the Excel program itself.


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 


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
Error while invoking stored procedure in hibernate avinash_thm Hibernate 5 April 25th, 2007 04:46 AM
Invoking Excel COM error rajeshnerenki ASP.NET 1.0 and 1.1 Professional 0 April 9th, 2006 08:33 AM
xp_cmdshell help needed. Clauddvon SQL Server 2000 2 March 1st, 2006 11:00 AM
Securing xp_cmdshell Steve_tucker SQL Server 2000 1 December 8th, 2004 06:44 PM
xp_cmdshell Steve_tucker SQL Server 2000 3 November 22nd, 2004 04:15 PM



All times are GMT -4. The time now is 11:51 AM.


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