Executing a DTS Package using an ASP (VBScript)

Executing a DTS Package using an ASP (VBScript)

am 01.02.2005 12:07:24 von chris.dunigan

I'm looking for an example of how to execute an existing DTS=AD package
from an
ASP (VB)script and would appreciate any and all response. =ADI don't
even
know if it's possible
Thanks
- Chuck Gatto


Dan Guzman Apr 27 2000, 12:00 am show options

Newsgroups: comp.databases.ms-sqlserver
From: "Dan Guzman" messages by this author
Date: 2000/04/27
Subject: Re: Executing a DTS Package using an ASP (VBScript) Script
Reply to Author | Forward | Print | Individual Message | Show original
| Report Abuse

This VBScript example loads and executes an existing DTS pac=ADkage from
SQL
Server.


Option Explicit
Const PackageName =3D "PackageName"
Const ServerName =3D "ServerName"
Const UserName =3D "UserName"
Const Password =3D "Password"
Dim DTSPk
Set DTSPk =3D CreateObject("dts.package")
DTSPk.LoadFromSQLServer ServerName, UserName ,Password
,,,,,=ADPackageName
DTSPk.Execute
If DTSPk.Steps(1).ExecutionResult =3D 0 Then
Response.Write "Package execution completed"
Else
Response.Write "Package execution failed"
End If
Set DTSPk =3D Nothing


You can also create the entire package from scratch from wit=ADhin your
asp and
execute it.


Hope this helps.



Chuck Gatto wrote in message


news:8eapo8$frj$1@slb7.atl.mindspring.net...


- Hide quoted text -
- Show quoted text -

> I'm looking for an example of how to execute an existing D=ADTS
package from
an
> ASP (VB)script and would appreciate any and all response.=AD I don't
even
> know if it's possible
> Thanks
> - Chuck Gatto


Chuck Gatto May 1 2000, 12:00 am show options

Newsgroups: comp.databases.ms-sqlserver
From: "Chuck Gatto" - Find messages by this
author
Date: 2000/05/01
Subject: Re: Executing a DTS Package using an ASP (VBScript) Script
Reply to Author | Forward | Print | Individual Message | Show original
| Report Abuse

Below code works 100% in VB but the load fails in ASP. I g=ADet...
"Microsoft OLE DB Provider for SQL Server. Login failed for =ADuser "\".
error.
I think the IIS (server a) is set for NT auth. and sql7 (on =ADserver b)
as
well but I can't be sure.
Any idea what I should look for.
Thanks



"Dan Guzman" wrote in m=ADessage


news:sgi3hi617qo89@corp.supernews.com...


- Hide quoted text -
- Show quoted text -

> This VBScript example loads and executes an existing DTS p=ADackage
from SQL
> Server.

> Option Explicit
> Const PackageName =3D "PackageName"
> Const ServerName =3D "ServerName"
> Const UserName =3D "UserName"
> Const Password =3D "Password"
> Dim DTSPk
> Set DTSPk =3D CreateObject("dts.package")
> DTSPk.LoadFromSQLServer ServerName, UserName ,Password
,,,=AD,,PackageName
> DTSPk.Execute
> If DTSPk.Steps(1).ExecutionResult =3D 0 Then
> Response.Write "Package execution completed"
> Else
> Response.Write "Package execution failed"
> End If
> Set DTSPk =3D Nothing


> You can also create the entire package from scratch from w=ADithin
your asp
and
> execute it.


> Hope this helps.


> Chuck Gatto wrote in message
> news:8eapo8$frj$1@slb7.atl.mindspring.net...
> > I'm looking for an example of how to execute an existing=AD DTS
package
from
> an
> > ASP (VB)script and would appreciate any and all respons=ADe. I
don't even
> > know if it's possible
> > Thanks
> > - Chuck Gatto



Dan Guzman May 1 2000, 12:00 am show options

Newsgroups: comp.databases.ms-sqlserver
From: "Dan Guzman" messages by this author
Date: 2000/05/01
Subject: Re: Executing a DTS Package using an ASP (VBScript) Script
Reply to Author | Forward | Print | Individual Message | Show original
| Report Abuse

You can specify a trusted connection with flag 256 instead o=ADf
username and
password. For example:


DTSPk.LoadFromSQLServer ServerName, , , 256,,,,PackageNa=ADme


Assuming this is an intranet application running under NT 4.=AD0 and you
want
to execute the package under the invoking user's account, yo=ADu can do
this as
follows:


Specify 'clear text' for the IIS Directory Security
auth=ADentication
Remove 'Everyone' from the access list on the files (req=ADuires
NTFS) and
grant permissions to the users
Grant logins access to the database server


With this method, users must enter their Domain\UserName and=AD password
when
prompted.


NT authentication presents a challenge when multiple servers=AD are
involved
because NT 4.0 does not support delegation. See
http://msdn.microsoft.com/workshop/server/feature/security.a sp for
details.
I understand Windows 2000 provides delegation capabilities b=ADut this
can be a
bit tricky to implement.


BTW, if your DTS package does not access SQL Server, you can=AD save it
to a
file and use the LoadFromStorageFile method instead.


Hope this helps.


If you need to use


Chuck Gatto wrote in message


news:8ekrkd$pmq$1@slb7.atl.mindspring.net...


- Hide quoted text -
- Show quoted text -

> Below code works 100% in VB but the load fails in ASP. I=AD get...
> "Microsoft OLE DB Provider for SQL Server. Login failed fo=ADr user
"\".
error.
> I think the IIS (server a) is set for NT auth. and sql7 (o=ADn server
b) as
> well but I can't be sure.
> Any idea what I should look for.
> Thanks


Chuck Gatto May 6 2000, 12:00 am show options

Newsgroups: comp.databases.ms-sqlserver
From: "Chuck Gatto" - Find messages by this
author
Date: 2000/05/06
Subject: Re: Executing a DTS Package using an ASP (VBScript) Script
Reply to Author | Forward | Print | Individual Message | Show original
| Report Abuse

Hey Dan
Thanks again. I really appreciate your input and help.
I actually solved the problem by calling dtsrun...
I apologize for the delay getting back w/you but thee recent=AD virus
atack
sidetracked me.
Thanks again.


"Dan Guzman" wrote in m=ADessage


news:sgsfh8spoog87@corp.supernews.com...


- Hide quoted text -
- Show quoted text -

> You can specify a trusted connection with flag 256 instead=AD of
username and
> password. For example:

> DTSPk.LoadFromSQLServer ServerName, , , 256,,,,Package=ADName


> Assuming this is an intranet application running under NT =AD4.0 and
you want
> to execute the package under the invoking user's account, =ADyou can
do this
as
> follows:


> Specify 'clear text' for the IIS Directory Security
au=ADthentication
> Remove 'Everyone' from the access list on the files (r=ADequires
NTFS)
and
> grant permissions to the users
> Grant logins access to the database server


> With this method, users must enter their Domain\UserName a=ADnd
password when
> prompted.


> NT authentication presents a challenge when multiple serve=ADrs are
involved
> because NT 4.0 does not support delegation. See
> http://msdn.microsoft.com/workshop/server/feature/security.a sp for
details.
> I understand Windows 2000 provides delegation capabilities=AD but this
can be
a
> bit tricky to implement.


> BTW, if your DTS package does not access SQL Server, you c=ADan save
it to a
> file and use the LoadFromStorageFile method instead.


> Hope this helps.


> If you need to use
> Chuck Gatto wrote in message
> news:8ekrkd$pmq$1@slb7.atl.mindspring.net...
> > Below code works 100% in VB but the load fails in ASP. =AD I get...

> > "Microsoft OLE DB Provider for SQL Server. Login failed =ADfor user
"\".
> error.
> > I think the IIS (server a) is set for NT auth. and sql7 =AD(on
server b) as
> > well but I can't be sure.
> > Any idea what I should look for.
> > Thanks



chris.duni...@agwsha.nhs.uk Jan 31, 10:05 am show options

Newsgroups: comp.databases.ms-sqlserver
From: chris.duni...@agwsha.nhs.uk - Find messages by this author
Date: 31 Jan 2005 10:05:00 -0800
Subject: Re: Executing a DTS Package using an ASP (VBScript) Script
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse

Hi,


I've tried adding this function to my ASP pages and get the =ADfollowing

error message;


Microsoft VBScript runtime error '800a01ad'


ActiveX component can't create object: 'DTS.Package'


/asp/pages/dts.asp, line 21


Does anyone have any idea what I need to fix to get the DTS =ADto work?


I'm v. new to SQL Server and ASP so any help would be apprec=ADiated.
Many thanks,=20
Chris Dunigan

Re: Executing a DTS Package using an ASP (VBScript)

am 01.02.2005 16:13:01 von aon14nocannedmeat

wrote in message
news:1107256044.746188.14660@c13g2000cwb.googlegroups.com...
I'm looking for an example of how to execute an existing DTS­ package
from an
ASP (VB)script and would appreciate any and all response. ­I don't
even
know if it's possible
Thanks
- Chuck Gatto

http://www.google.co.uk/search?hl=en&q=dts+package+vbscript& meta=

Your package.
It works OK if you try and run it from Enterprise Manager on your machine?

You tried a real user and password in those fields when you tried that
method?
This would be equal to the user you're logged on as?

--
Regards,
Andy O'Neill

Re: Executing a DTS Package using an ASP (VBScript)

am 01.02.2005 17:50:07 von chris.dunigan

Hi Andy,

Yes the DTS Package works fine when I run it from Enterprise Manager;
and I have used the correct server name, username, password and
packagename.

Having done some more digging into this error I found a site that told
me it could be something to so with the software installed on the PC on
which the database resides.
I think I might need to ensure that dtspkg.dll is correctly installed
(along with a host of other dll and rll's).
As I can't get hold of our IT guys today I haven't been able to see if
this solves my problem.

Does this sound like it may fix the problem??

Regards,
Chris

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Re: Executing a DTS Package using an ASP (VBScript)

am 01.02.2005 20:27:15 von Simon Hayes

"Chris Dunigan" wrote in message
news:41ffb33f$1_2@127.0.0.1...
>
>
> Hi Andy,
>
> Yes the DTS Package works fine when I run it from Enterprise Manager;
> and I have used the correct server name, username, password and
> packagename.
>
> Having done some more digging into this error I found a site that told
> me it could be something to so with the software installed on the PC on
> which the database resides.
> I think I might need to ensure that dtspkg.dll is correctly installed
> (along with a host of other dll and rll's).
> As I can't get hold of our IT guys today I haven't been able to see if
> this solves my problem.
>
> Does this sound like it may fix the problem??
>
> Regards,
> Chris
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

These links might help:

http://www.sqldts.com/default.aspx?207
http://support.microsoft.com/default.aspx?scid=kb;en-us;2529 87
http://support.microsoft.com/default.aspx?scid=kb;en-us;3236 85
http://support.microsoft.com/default.aspx?scid=kb;en-us;2824 63

Simon

Re: Executing a DTS Package using an ASP (VBScript)

am 02.02.2005 17:33:35 von aon14nocannedmeat

"Chris Dunigan" wrote in message
news:41ffb33f$1_2@127.0.0.1...
> Hi Andy,
>
> Yes the DTS Package works fine when I run it from Enterprise Manager;
> and I have used the correct server name, username, password and
> packagename.
>
> Having done some more digging into this error I found a site that told
> me it could be something to so with the software installed on the PC on
> which the database resides.
> I think I might need to ensure that dtspkg.dll is correctly installed
> (along with a host of other dll and rll's).
> As I can't get hold of our IT guys today I haven't been able to see if
> this solves my problem.
>
> Does this sound like it may fix the problem??

If no dts package works when run from a job on the server.


Quite frankly, I'm confused by your huge initial post as to which technique
you're trying and what's going on.


I'm wondering if this is running and owned by a user can run the dts package
OK on the server using whichever of the alternatives you posted you're
currently trying.

Try this with the package if it's vbscript using any activex.
Open DTS Designer, right-click the task, select Workflow, then Workflow

Properties. On the Options tab, check "Execute on main package thread"


--
Regards,
Andy O'Neill