Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Posts
    10

    Unanswered: Calling DTS package with Send Mail object from VB

    I have several processes that call DTS packages (SQL Sever 7) from VB6, and they work fine. The problem is that if there is a "Send mail" task in the package, it won't send the email if called from VB.

    If I run the package directly through enterprise manager, the email gets sent, but if run through VB it does not.

    Any ideas?

    The vb code is below.

    Thanks.

    Lionel

    Private Sub Command1_Click()

    Dim objPackage As DTS.Package
    Const DTSReposFlag_UseTrustedConnection = 256
    Dim tServer As String

    Set objPackage = New DTS.Package
    tServer = "SQLBOX"
    objPackage.LoadFromSQLServer tServer, "", "", DTSReposFlag_UseTrustedConnection, "", "", "", "dts_test"
    objPackage.Execute
    Set objPackage = Nothing

    End Sub

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    Please, post your DTS task that includes a call to xp_sendmail.

  3. #3
    Join Date
    May 2002
    Posts
    10
    I'm not actually sure how to post the DTS Package. When I script it through enterprise manager (Open the package and Save AS) then it saves in a unreadable format

    (e.g. DZb%oܡ`;\D|JkjÌg).

    Please could you let me know.

    Thanks,

    lwaker

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •