Call DTS from VB - SQL Server does not exist or access denied -
06-02-2006
, 04:38 PM
Hello all,
I am trying to call a DTS package from Machine A which is located on
the same domain as Machine B. Machine A is an XP box, Machine B is a
SS2k.
What I am trying to accomplish is run a VB 6.0 application which will
invoke the DTS package on the server. I have written the application,
below you will find the code.
' Set Parameter Values for DTS packages
sServer = "DBNAME"
sUsername = "user"
sPassword = "pass"
sPackageName = "PackageName"
sPackagePassword = "PackagePassword"
Set oPKG = New DTS.Package
oPKG.LoadFromSQLServer sServer, sUsername, sPassword, _
DTSSQLStgFlag_Default, sPackagePassword, , , sPackageName
For Each oStep In oPKG.Steps
oStep.ExecuteInMainThread = True
Next
oPKG.Execute
If I run this code from a simple form object on the SQL server (Machine
B), it runs with no problem. If I run the same exact code from Machine
A on the domain I get the error - access denied. I have tried using a
domain administrator account, but to no avail. Other things to note, I
have a stored procedure within the code, which executes fine from
Machine B.
I have tried both windows authentication mode and sql authentication
mode on the LoadFromSQLServer call. Nether of these worked.
Please someone ... any help? |