CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: DTS

  1. #1
    Join Date
    May 1999
    Location
    Michigan, USA
    Posts
    7

    DTS

    I created a DTS package in SQL Server 2000 and saved it as a VB file (.bas). It runs fine in VB (a table is copied from one database to another).

    There is no error handling code in the package. I am wondering whether I should add error handling. I saw an example in MSDN and tried to implement it in my package. I used OnError GoTo DTSPackageErr and coded my error handler. I set the FailOnError property to true. I changed the database name to some non-existent name and ran my code. It ran fine, the database table was copied and no error was generated.

    Does anyone have an example of error handling in a DTS package. Thanks!


  2. #2
    Join Date
    Oct 2001
    Location
    Chennai, India
    Posts
    9

    Re: DTS

    First all, i would like to know about your DTS package can you explain me please....?

    Thank u in advance
    spkrish


  3. #3
    Join Date
    May 1999
    Location
    Michigan, USA
    Posts
    7

    Re: DTS

    I created the package in SQLServer import/export wizard, saving it as a .bas file. Then I added it to my VB project. Essentially, I have the identical table structure in two different SQL Server databases. The user only updates one of the tables. The VB program compares the table data and if different, calls the DTS package code to then copy one table to the other.

    I wanted to add error handling in case the copy didn't complete or the power went out. Am looking for info on error handling in DTS.

    Thanks for your help.


  4. #4
    Join Date
    Oct 1999
    Posts
    16

    Re: DTS

    If ur using the same bas file as it is it is not possible. Instead u generalize the code and move it into a form then it is possible.

    Here is the Example

    in the module the code will be like this

    Public goPackageOld As New DTS.Package
    .....

    Now when u move this code to form it will be like

    Public WithEvents goPackageOld As DTS.Package
    --

    and in form load event create new instance of the object. Now u can see goPackageOld_OnError event in the form. now u can trap the errors.

    If this is serving ur purpose then Cheers else let me see other angle of the problem from u.

    Cheers and HAPPY NEW YEAR.

    chilakamati at yahoo




Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured