Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi -

I have a web page that I'm trying to access an ssis package and run the import. The issue is that the package fails with an error of

'Failed to open package file "@P:\Users\TroyB\KitImport.dtsx" due to error 0x8007007B "The filename, directory name, or volume label syntax is incorrect.". This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.'

The excel file location is hard coded for now along with location of the import package. Here is the example of that I was following :Excecute SSIS package (DTSX) from ASP.Net[^]

Here is the code :

Dim pkgLocation As String
Dim pkg As New Package
Dim app As Application = New Application
Dim pkgResults As DTSExecResult
Dim fileName As String = "@P:\Users\TroyB\MyKitImport.xls"
Dim eventListener As New EventListener
pkgLocation = "@P:\Users\TroyB\KitImport.dtsx"
pkg = app.LoadPackage(pkgLocation, eventListener)
pkgResults = pkg.Execute()


Thanks in advance
Posted

1 solution

The error is exactly correct and clear. You are trying to open "@P:\Users\TroyB\KitImport.dtsx". Note that you have the "@" in your path. If you copied from C# the @ is a special code so that \ does not get treated as an escape character.

Since you are doing VB you don't need that @.
 
Share this answer
 
Comments
Troy Bryant 14-May-15 16:59pm    
That's the first thing I removed only to get the same error.
ZurdoDev 14-May-15 17:00pm    
Then make sure P is accessible from where the code is running and that the path is correct.
Troy Bryant 14-May-15 17:04pm    
I started it out on my desk top in my documents folder. Some permissions I couldn't change so moved it to the shared drive which is the P drive and still receiving this error
ZurdoDev 14-May-15 19:32pm    
What is the exact error now?
Troy Bryant 14-May-15 20:19pm    
Error if its on the P "shared" drive is "The filename, directory name, or volume label syntax is incorrect." or if on the C drive "Access Denied"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900