Sunday, March 25, 2012

DTS Errors with Access?

Hi,

I have a DTS package that when executed through Enterprise Manager works just fine.
I have an Access app on a different computer that executes the DTS package via VB using the syntax below. This process causes the DTS package to return an error of 'SQL Server Does Not Exist or Access Denied'.
I have tried both authentication types, not making a difference. I have used the SA login from Access and still get the error. All the necessary DTS drivers are installed on the second box and I can connect to the SQL tables succesfully also...
Any ideas? Thanks!

Private Sub cmd_MPSDTS_Click()

Dim oPackage As New DTS.Package
On Error GoTo eh

oPackage.LoadFromSQLServer "SVRName", "sa", "pwd", DTSSQLStgFlag_Default, "", "", "", "Pkg_Name", 0
'Execute the Package

oPackage.Execute
'MsgBox oPackage.Description, vbInformation, _
"Re-import Excel sheet."

'Clean up.
MsgBox ("Ran DTS Package")
Set oPackage = Nothing
Exit Sub
eh:
MsgBox Err.Description, vbCritical, _
"Error Running Package"

End SubI assume you have tried pinging the server from the machine with the access db? or rather from the machine that opens the access db.|||You should also check that the user you are executing as from Access is the same as the user that is executing from Enterprise Manager or at least has the same privileges.|||Not sure why that would make a difference (Not saying it wouldn't, I'm just not sure why it would). The error they are receiving makes it look as though they can't reach the server at all...|||Found the problem,

The DTS package imported information from an Informix database. The necessary drivers weren't installed on the second machine so the job failed even though I could connect to the SQL server just fine. I got around it by changing the code to execute a SQL Job which in turn executed the DTS package. This way it ran on the SQL server.

Thanks!

No comments:

Post a Comment