Link to home
Start Free TrialLog in
Avatar of netsol07
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("PackageLocation"))
        pkg = app.LoadPackage(pkgLocation, Nothing)
        pkgResults = pkg.Execute()
        If (pkgResults = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure) Then
            pkg.Variables("ErrorDescription").Value.ToString()
        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."
Avatar of netsol07
netsol07

ASKER

I kind od realized that the package is failing, hence looking gor the variable ErrorDescription. How do I find out why the package is failing? As it runs fine on dev instace.
ASKER CERTIFIED SOLUTION
Avatar of nmcdermaid
nmcdermaid

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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,
SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial