flaviooooo
Programmer
Hi,
I'm trying to import a text-file into an Access ADP. For this I use a DTS package, which works fine.
Now i'm trying to trigger this DTS package from my Access-form. I have not found anyway better than creating a job that runs this DTS Package, and subsequently creating a stored procedure that runs the job.
Is there a better way to run the DTS than this?
Anyway, if I would leave it like this with the running of the stored procedure: Is there a way to get some kind of errormessage if the job went wrong? When I run the code now and it fails, it doesn't tell me anything...
Any advice?
The code is as follows:
Thanks in advance
Kind regards
Fabian
I'm trying to import a text-file into an Access ADP. For this I use a DTS package, which works fine.
Now i'm trying to trigger this DTS package from my Access-form. I have not found anyway better than creating a job that runs this DTS Package, and subsequently creating a stored procedure that runs the job.
Is there a better way to run the DTS than this?
Anyway, if I would leave it like this with the running of the stored procedure: Is there a way to get some kind of errormessage if the job went wrong? When I run the code now and it fails, it doesn't tell me anything...
Any advice?
The code is as follows:
Code:
Dim cnn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rst As New ADODB.Recordset
Dim param1 As Parameter, param2 As Parameter, param3 As Parameter, param4 As Parameter
' Connect
Set cnn = CurrentProject.Connection
Set cmd.ActiveConnection = cnn
' Set up a command object for the stored procedure.
cmd.CommandText = "sp_Import_Stock_Slough"
cmd.CommandType = adCmdStoredProc
' Execute command and return results to recordset
Set rst = cmd.Execute
Thanks in advance
Kind regards
Fabian