![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Vbscript calling DTS package Hi, I need to call a DTS package from a vbscript. The vbscript can not use xp_cmdshell to call the DTS package. The vbscript would be scheduled and executed on the server. Is there a resource that I can be pointed to for the information? Thanks in advance. |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Vbscript calling DTS package "research_stuff" wrote: Quote: > Hi, > > I need to call a DTS package from a vbscript. The vbscript can not use > xp_cmdshell to call the DTS package. The vbscript would be scheduled > and executed on the server. > > Is there a resource that I can be pointed to for the information? > > > Thanks in advance. > You can manipulate DTS packages from VBScript using DTS object model: http://msdn.microsoft.com/en-us/libr...5(SQL.80).aspx Const TrustedConn = 256 Set objPackage = CreateObject _ ("DTS.Package2") objPackage.LoadFromSQLServer _ "(local)", , , TrustedConn, , , , "PackageName" objPackage.Execute But if you just need to run the package, it is simpler to use Dtsrun.exe: http://msdn.microsoft.com/en-us/libr...7(SQL.80).aspx -- urkec |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Vbscript calling DTS package "research_stuff" <learnstuff1@xxxxxx> wrote in message news:5c163158-7c4c-4580-844a-512f99c05ee2@xxxxxx Quote: > Hi, > > I need to call a DTS package from a vbscript. The vbscript can not use > xp_cmdshell to call the DTS package. The vbscript would be scheduled > and executed on the server. > > Is there a resource that I can be pointed to for the information? > > > Thanks in advance. > Const DTSSQLStgFlag_Default = 0 Const DTSStepExecResult_Failure = 1 Const DTSSQLStgFlag_UseTrustedConnection = 256 Set dtsRun = CreateObject("DTS.Package") dtsRun.LoadFromSQLServer "MySqlServerMa,e","","",DTSSQLStgFlag_UseTrustedConnection,"","","","MY-DTS-NAME" dtsRun.Execute() ' some error checking. DTSresult = True For Each dtsStage In dtsRun.Steps If dtsStage.ExecutionResult = DTSStepExecResult_Failure Then DTSresult = False Main = DTSTaskExecResult_Failure if (dtsRun.Tasks(dtsStage.TaskName).Description = "write error message" OR dtsRun.Tasks(dtsStage.TaskName).Description = "send email") then DTSResult = True end if Else End If Next |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Calling a VBScript from Access | VB Script | |||
| calling WinAPIs from VBScript | VB Script | |||
| Calling Executable from VBScript | VB Script | |||
| How to do No hang up VBScript (nohup for VBScript) | VB Script | |||
| Uninstalling a .msi package | Vista General | |||