I had this saved as a snippet, I don't know who wrote it, but it gives syntax using CF.
Robert
Several people have written the list, inquiring as to how they can execute a
SQL Server DTS Package from ColdFusion. Here is the default syntax for the
object and it's methods in question (loading from either SQL Server,
Repository, or File), along with a (simple) code example.
Default Syntax to Create DTS Object:
<cfobject type="COM" name="myObjectName" class="DTS.Package"
action="CREATE">
LoadFromSQLServer Syntax:
ObjectName.LoadFromSQLServer("ServerName",
"ServerUserName",
"ServerPassword",
"Flags",
"PackagePassword",
"PackageGuid",
"PackageVersionGuid",
"PackageName",
"pVarPersistStgOfHost")
LoadFromStorageFile Syntax:
ObjectName.LoadFromStorageFile("UNCFile",
"Password",
"PackageID",
"VersionID",
"Name",
"pVarPersistStgOfHost")
LoadFromRepository Syntax:
ObjectName.LoadFromRepository("RepositoryServerName",
"RepositoryDatabaseName",
"RepositoryUserName,
"RepositoryUserPassword,
"PackageID,
"VersionID,
"PackageName,
"Flags",
"pVarPersistStgOfHost")
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
Code to execute a 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>
<CFSET r =
objDTS.LoadfromSQLServer("SHORWITH","sa","",0,"","","","test","")>
<CFIF isDefined("error_message")>
<cfoutput> #error_message# </cfoutput>
</cfif>
<CFSET p= objDTS.Execute()>
-----Original Message-----
From: Jacob Cameron [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 2:53 PM
To: [EMAIL PROTECTED]
Subject: RE: Execute DTS Package WAS RE: CFDirectory - DateLastModified
Very cool. I searched that, but didn't see anything about DTS. I did see
Stored Procedure and trigger classes though. Do you know which classes have
subroutines or functions to call DTS packages?
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of David L. Penton
Sent: Wednesday, February 07, 2001 2:33 PM
To: [EMAIL PROTECTED]
Subject: RE: Execute DTS Package WAS RE: CFDirectory - DateLastModified
You can do this without creating a SP for that by using the SQL DMO objects
library and using <CFOBJECT>
I would recommend doing it in VB (or similar technology) first to get the
correct syntax and commands down, then convert to CF (or even write a DLL to
execute it, but that may be the same result as writing a Stored Procedure to
do it)
hth...
David L. Penton, MCP
Consultant
"Mathematics is music for the mind, and Music is Mathematics for the
Soul. - J.S. Bach"
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, February 07, 2001 2:17 PM
Is there a way to execute a local server DTS package from within
coldfusion? I already have the package created, I just want the user to be
able to execute the import from an administration screen. Or is the only
alternative to build a stored procedure to accomplish the same task?
Thanks for the input,
CC
-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org
-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org
