>Hi all,
>I have created a DTS package to transfer data in Local Packages of SQL Server.
>I wish to call and run it programmatically from my VFP application.
>besides use set time schedule, any other method to call it? such as use EXEC command
>to execute the package name, is it possible?
>thanks for any help.
It can be as simple as this:
loDts = newobject('dts.package')
loDts.LoadFromSqlServer( {you will need to supply param values here} )
loDts.Execute()
Check out the Package object in SQL Books Online for information on the parameters that the LoadFromSqlServer() expects. Basically you need to supply the server name and login info, and the package name.
One thing to watch out for: DTS packages store versions internally, so if you have multiple versions you will need to go thru the SavedPackageInfos collection to get the one you want.
Hope this helps.
Dan LeClair
www.cyberwombat.comSET RANT ON - The Wombat BlogLife isn’t a morality contest and purity makes a poor shield. - J. Peter MulhernDisclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.