SQL Server DTS permissions problem
From: DC (cyrdg@hotmail.com)
Date: 10/16/02
- Next message: Terry: "Re: Security in Linked Servers"
- Previous message: mike: "Change users to Mixed Mode"
- Next in thread: Sue Hoegemeier: "Re: SQL Server DTS permissions problem"
- Reply: Sue Hoegemeier: "Re: SQL Server DTS permissions problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: cyrdg@hotmail.com (DC) Date: 16 Oct 2002 07:31:04 -0700
All, I am trying to execute a SQL 2000 DTS package from within an
.aspx page (See code snippet below). The package works fine if I run
it through enterprise manager. However, when I execute it via the
below listed code the package fails. The package is actually created,
the global variable is set and the package is executed. The problem
seems to be in the area of permissions. The first task in the package
attempts to execute a simple activex script which creates a
filesystemobject and looks for a .txt file on our network in a
particular directory. Even though the dir and file both exist, the
error in the DTS generated log file says that no such dir exists. I've
tried to duplicate the problem in enterprise manager by not using
windows auth and by instead entering the username and password
(different from my network logon and pw) in the code below but to no
avail. Any help would be greatly appreciated.
DC
Public Function RunDTS() As String
Dim oPackage As New DTS.Package()
Dim iIndex As Integer
Dim sReturnVal As String
Dim iStatus As Boolean = True
If ImpersonateValidUser("domainusername", "domain",
"domainpassword") Then
oPackage.LoadFromSQLServer("ServerName",
"SqlSrvrusername", "SqlSrvrpassword",
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, Nothing, Nothing,
Nothing, "DTS Package Name", "")
oPackage.GlobalVariables.Item("gvIndex").Value = 1 'gv
used in execution of package
oPackage.Execute()
For iIndex = 1 To oPackage.Steps.Count
If oPackage.Steps.Item(iIndex ).ExecutionResult =
DTS.DTSStepExecResult.DTSStepExecResult_Failure Then
oPackage.Steps.Item(iIndex).GetExecutionErrorInfo(lpErrorCode)
iStatus = False
sReturnVal = oPackage.Steps.Item(iIndex).Name & "
in the " & oPackage.Description & " failed.<BR>"
End If
Next
If iStatus = True Then
sReturnVal = oPackage.Description & " Successful<BR>"
End If
End If
Return sReturnVal
End Function
- Next message: Terry: "Re: Security in Linked Servers"
- Previous message: mike: "Change users to Mixed Mode"
- Next in thread: Sue Hoegemeier: "Re: SQL Server DTS permissions problem"
- Reply: Sue Hoegemeier: "Re: SQL Server DTS permissions problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|