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 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Passing parameters to DTS from VB Access

Author  Topic 

Teachme
Starting Member

45 Posts

Posted - 2006-12-05 : 18:33:09
hi
can plz anyone guide me how to run a DTS package from Access using DTSRUN. I'm using the following code but its not working out. Its not passing my parameters (account, and report end date) to the DTS package. any suggestion would be appreciated. thanks


Private Sub cmd_Execute_DTSpckg_Click()
Dim sName
Dim RptEndDt As String
Dim pkgName As String
Dim account_parent As String

sName = "svrname"
pkgName = "dtspackagename"
account = "9000400"
RptEndDt = "20060930"

Shell ("dtsrun /S """ & sName & """ /E /N """ & pkgName & _
""" /A """ & sName & """ : ""8"" = """ & RptEndDt & _
""" /A """ & sName & """ : ""8"" = """ & account & """")




End Sub

nr
SQLTeam MVY

12543 Posts

Posted - 2006-12-06 : 05:55:09
The format is
/A varname:type=value

you are passing the global variable name as the server name in both cases - it should be the name of the variable.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -