Take a look at
HOWTO: Execute a SQL Server 7.0 DTS Package from Visual FoxPro mskb #
Q247356.
>My application requires me to pull data from SQL Server and dump it into another format. The 'hard way' would seem to be to retrieve the data in VFP and then write it out. This works fine but it seems overly complicated. I can create a DTS package on the SQL Server that performs the export directly, but what I can't fgure out is if there is a way to call this through SPT or another mechanism in the way that you would call a stored procedure. It would also have to be parameterized, as I will be passing the key value for the one record I need to copy each time.
> I am unfortunately bound to this by the third party application I will be controlling via an activex interface. The application allows the creation of queries directly against SQL Server tables, but has no mechanism for parameterizing those queries, rendering it useless for automation against a large SQL table. Instead, I need to preselect the data in VFP and pass it via a generic query to the application. I can do it all through VFP, but it just seems to me that running it all via SP's on the server would be the 'right' way to do it.
>
> Thanks,
> Randy
--sb--