netsol07
asked on
Error running the Package: The variable cannot be found
I'm trying to run a package by asp.net web App and I'm getting an error. The interesting thing is, It runs very fine on my Dev db instance but errors out on prod db instance. I checked all the settings of the accounts/package properties are the same.
Here is the code I've used:
Dim pkgLocation As String
Dim pkg As New Package
Dim app As New Application
Dim pkgResults As DTSExecResult
pkgLocation = _
Server.MapPath(AppSettings ("PackageL ocation"))
pkg = app.LoadPackage(pkgLocatio n, Nothing)
pkgResults = pkg.Execute()
If (pkgResults = Microsoft.SqlServer.Dts.Ru ntime.DTSE xecResult. Failure) Then
pkg.Variables("ErrorDescri ption").Va lue.ToStri ng()
End If
And here is the error message I'm getting : (By the way there are no variables used by the package)
"Couldn't Run the Package: The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created."
Here is the code I've used:
Dim pkgLocation As String
Dim pkg As New Package
Dim app As New Application
Dim pkgResults As DTSExecResult
pkgLocation = _
Server.MapPath(AppSettings
pkg = app.LoadPackage(pkgLocatio
pkgResults = pkg.Execute()
If (pkgResults = Microsoft.SqlServer.Dts.Ru
pkg.Variables("ErrorDescri
End If
And here is the error message I'm getting : (By the way there are no variables used by the package)
"Couldn't Run the Package: The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created."
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'll try to do that and get back.
The package runs perfectly fine even on prod db when i run it from sql integration services but errors out while running from the web app. I checked the user accounts to the file folders where the package is located but everything looks fine,
The package runs perfectly fine even on prod db when i run it from sql integration services but errors out while running from the web app. I checked the user accounts to the file folders where the package is located but everything looks fine,
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER