April 7, 2004 at 1:31 pm
Is there a way to execute a DTS package from within Access 2002. Scenerio:
I have a Access 2002 MDB that has a command button on the form that when it clicks it needs to execute a DTS package.
Any ideas would be great.
Arthur Lorenzini
April 8, 2004 at 2:48 am
Can you trigger an operating system command from within Access, and run dtsrun? See "dtsrun Utility" in BOL.
Perhaps a RunApp action in a macro, then assign the macro to the command button? Don't know Access too well so don't know if there are any limitations to this.
April 8, 2004 at 6:22 am
I also don't use Access but I do execute DTS packages from Visual FoxPro. I have not tested the following code but it may give you a start.
Function Main()
Dim objPackage
Set objPackage = CreateObject(“DTS.Package2”)
objPackage.LoadFromSQLServer “ServerName”, “username”, “userpassword”, _
, , , , “YourPackage”
objPackage.Execute
objPackage.Uninitialize
Set objPackage = nothing
Main = DTSTaskExecResult_Success
End Function
I got this from the DTS chapter in "Professional SQL Server 2000 Programming" published by Wrox. I had to translate this VBScript into VFP code but it worked well for me.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply