Default Syntax to Create DTS Object:
<cfobject type="COM" name="myObjectName" class="DTS.Package"
action="CREATE">

There are 3 primary locations DTS packages are generally loaded from: from
SQL Server, from Storage File, or from repository.  There are 3 different
primary methods that can be executed, one for each of these DTS locations.

LoadFromSQLServer Syntax:

ObjectName.LoadFromSQLServer("ServerName",
                "ServerUserName", 
                "ServerPassword", 
                "Flags", 
                "PackagePassword", 
                "PackageGuid", 
                "PackageVersionGuid", 
                "PackageName", 
                "pVarPersistStgOfHost")

NOTE: if you want to retrieve the PackageGuid, PackageVersionGuid,
PackageName from the database, run the sp_enum_dtspackages system stored
procedure.
it returns the following variables: name, id, versionid, description,
createdate, owner, size, packagedata, isowner 


LoadFromStorageFile Syntax:
ObjectName.LoadFromStorageFile("UNCFile", 
                "Password", 
                "PackageID", 
                "VersionID", 
                "Name", 
                "pVarPersistStgOfHost")


LoadFromRepository Syntax:
ObjectName.LoadFromRepository("RepositoryServerName", 
                "RepositoryDatabaseName", 
                "RepositoryUserName, 
                "RepositoryUserPassword, 
                "PackageID, 
                "VersionID, 
                "PackageName, 
                "Flags", 
                "pVarPersistStgOfHost")

     


This is sample code to execute a (SQLServer) DTS from ColdFusion ("objDTS"
is the Object I created, server is "shorwith", username is "sa" with no
password, "test" is the name of the DTS):

<CFTRY>
        <cfobject type="COM" name="objDTS" class="DTS.Package"
action="CREATE">
        <cfcatch type="Object">
                <CFSET error_message = "The DTS Package Object Could Not Be
Created">
        </cfcatch>
 </CFTRY>

<CFTRY>
         <CFSET r =
objDTS.LoadfromSQLServer("SHORWITH","sa","",0,"","","","test","")>
        <CFCATCH>
                <CFSET error_message = "The DTS Package Could Not Be Loaded
>From the SQL Server at this time.">
        </cfcatch>
</CFTRY>

 <CFIF isDefined("error_message")>
        <cfoutput> #error_message# </cfoutput>
 </cfif>

 <CFSET p= objDTS.Execute()>

~Simon

> Simon Horwith
> Allaire Certified ColdFusion Instructor
> Certified ColdFusion Developer
> Fig Leaf Software
> 1400 16th St NW, # 220
> Washington DC 20036
> 202.797.6570 (direct line)
> www.figleaf.com
> 


-----Original Message-----
From: Rif Kiamil [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 9:33 AM
To: CF-Talk
Subject: RE: Running a MS SQL Server DTS Package from ColdFusion


very easy to run DTS from CF.

here is an e.g.

<cfquery name="DTSImport" datasource="#DSN#">
master.dbo.xp_cmdshell 'DTSRun /~S
0x570181FD8A97DA72994BA30CD26A73E4C23626D16140CF0 /~U 0xF8141F8065D98248 /~P
0x23CAD6B1F4C4A4FBA499C068C0851BA3F2B320313D854C83 /~N
0x8633C5F800EA5FB74BA6756A1A7C499E0BECB133550E554589B918A33667AFE11A2A97320E
29F6FC8431DEF154CA67B '
</cfquery>

U can find the hexadecimal encrypted sting by scheduling the DTS then go in
to the Job, under SQL SEM, Management, Jobs, Properties, Steps, Edit the
step that runs your DTS it will have the command u need to run (the command
will look like this DTSRun /~S
0x5701181D8A97DA72994BA30CD26A73E4C23626D16140CF0 /~N
0x5AEDF53AEB844805D84A0F5C167B98D34FDD2EBBCC75CAF55AFED3C357DA785DD056F835CB
5B36BB365A3B921227B99 /E ).


>From Rif
-----Original Message-----
From: Percy E Perez [mailto:[EMAIL PROTECTED]]
Sent: 16 January 2001 18:14
To: CF-Talk
Subject: Running a MS SQL Server DTS Package from ColdFusion


Anyone has any suggestions on how to run a DTS package from a coldfusion 
page?
I found article# Q252987 on technet on how to do this using ASP, but I 
would rather implemented in ColdFusion.  Thank you for any suggestions.


Percy E Perez


> -----Original Message-----
> From: Clint Tredway [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 16, 2001 11:59 AM
> To: CF-Talk
> Subject: RE: SQL Manager
>
>
> Yep, this will be taken care of soon.
>
> -----Original Message-----
> From: Neil Clark [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 16, 2001 10:44 AM
> To: CF-Talk
> Subject: RE: SQL Manager
>
>
>  yep, I would NEVER want anyone connecting to the Master DB.
> I always keep
> my SQL Servers on the inside of the firewall allowing no
> access from the
> outside world - only from the cf server.
>
> Neil
>
> <! -----------------------------------
> Neil Clark
> Senior Web Applications Engineer
> ColdFusion / Spectra / XML
> mcb digital [Allaire Premier Partner]
> Tel. +44 (0)20 8941 3232
> Tel. +44 (0)20 8408 8131 [Direct]
> http://www.mcbdigital.com
> ----------------------------------->
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to