Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Run DTS package from MS Access form

Author  Topic 

jbphoenix
Yak Posting Veteran

68 Posts

Posted - 2009-03-06 : 12:58:34
I'm trying to run a dts package from an access form. Here is the code I have but i'm getting an error.

[CODE]Dim dtsPackage As New DTS.Package
dtsPackage.LoadFromStorageFile "C:\POS.dtsx", ""
dtsPackage.Execute[/CODE]

Run-Time error -2147220220 (80040504) The Specified file is not a Package Storage File.

mfemenel
Professor Frink

1421 Posts

Posted - 2009-03-06 : 14:03:17
You're trying to use dtsPackage.LoadFromStorage. I believe you would need to use dtsPackage.LoadFromSQLServer

Mike
"oh, that monkey is going to pay"
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-03-06 : 15:15:09
This is very interesting.
LoadFromStorageFile is for DTS packages, it will not work for SSIS packages. For SSIS packages you haev to use the Microsoft_SqlServer_ManagerDTS.dll reference. But you can't just use it out of the box. As the first link here shows "You cannot reference a managed assembly from a COM application without first generating a COM callable wrapper".
http://www.mydatabasesupport.com/forums/ms-sqlserver/221898-ssis-package-using-vba.html
This link shows you how to generate a COM callable wrapper.
http://msdn.microsoft.com/en-us/library/hfzzah2c(VS.80).aspx

or you could migrate to C# :)
Go to Top of Page
   

- Advertisement -