dbTalk Databases Forums  

Porting a bas DTS to VB.net: 99% success

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Porting a bas DTS to VB.net: 99% success in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Simone Chemelli
 
Posts: n/a

Default Porting a bas DTS to VB.net: 99% success - 04-03-2005 , 04:52 PM






Hi all!

I have created a dts package with SQL 2000 SP3a hotfix 818.
I saved it as bas file and imported in my VB.NET service; I then fixed the small issues remaining with VB6->VB.NET translations.
The service compile file and works for a while than crashes without notice.
The debugger says that there is no code line to show but only assembly: seems to crash outside my code, somewhere in the CLR !!!

I then created a lot of breakpoints and found that the problematic functions are:
Call oCustomTask1_Trans_SubXX(oCustomTask1)

where XX is everytime different ( I have 29 transformations ).

Can anyone give me an idea on how to identify the problem and then fix it ?

Thank you in advance for any answer,

Simone




Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Porting a bas DTS to VB.net: 99% success - 04-04-2005 , 07:25 AM






I would take the code of the service and test it first, then put it back. Services are very difficult to debug and work I find.

Some common isues-

Converting a DTS Package from Visual Basic 6.0 to Visual Basic .Net
(http://www.sqldts.com/default.aspx?264)


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com
"Simone Chemelli" <simone.chemelli.removethis (AT) serinf (DOT) it.nospam> wrote

Hi all!

I have created a dts package with SQL 2000 SP3a hotfix 818.
I saved it as bas file and imported in my VB.NET service; I then fixed the small issues remaining with VB6->VB.NET translations.
The service compile file and works for a while than crashes without notice.
The debugger says that there is no code line to show but only assembly: seems to crash outside my code, somewhere in the CLR !!!

I then created a lot of breakpoints and found that the problematic functions are:
Call oCustomTask1_Trans_SubXX(oCustomTask1)

where XX is everytime different ( I have 29 transformations ).

Can anyone give me an idea on how to identify the problem and then fix it ?

Thank you in advance for any answer,

Simone




Reply With Quote
  #3  
Old   
Ron
 
Posts: n/a

Default Porting a bas DTS to VB.net: 99% success - 04-04-2005 , 11:29 AM



I have been able to get a DTS package from a VB6 app to
run in VB.Net. After you run the upgrade wizard you just
need to cast a few items like this:

Public Sub Main()
'--these are the items I had to change/CType in Sub Main
'--Note: I left a few of the old statements but commented
'--them out. Anywhere you see a CType - that is a change
'--So just look for where VB.Net is complaining in your
'--package and that is where you have to Cast/CType

'goPackage = goPackageOld
goPackage = CType(goPackageOld, DTS.Package2)


goPackage.PackagePriorityClass = CType(2,
DTS.DTSPackagePriorityClass)

goPackage.TransactionIsolationLevel = CType(4096,
DTS.DTSIsolationLevel)

'goPackage.Connections.Add(oConnection)
goPackage.Connections.Add(CType(oConnection,
DTS.Connection))

'goPackage.Connections.Add(oConnection)
goPackage.Connections.Add(CType(oConnection,
DTS.Connection))

oStep = CType(goPackage.Steps.New, DTS.Step2)

oStep.ExecutionStatus = CType(1, DTS.DTSStepExecStatus)

oStep.RelativePriority = CType(3,
DTS.DTSStepRelativePriority)

tracePackageError(CType(goPackage, DTS.Package))

End Sub
'-----------------------------------------------

Public Sub tracePackageError(ByRef oPackage As DTS.Package)
....
For i = 1 To CType(oPackage.Steps.Count, Short)
If oPackage.Steps.Item(i).ExecutionResult =
DTS.DTSStepExecResult.DTSStepExecResult_Failure Then
oPackage.Steps.Item
(i).GetExecutionErrorInfo(ErrorCode, ErrorSource,
ErrorDescription, ErrorHelpFile, ErrorHelpContext,
ErrorIDofInterfaceWithError)
MsgBox(oPackage.Steps.Item(i).Name & "
failed" & vbCrLf & ErrorSource & vbCrLf & ErrorDescription)
End If
Next i
End Sub
'-----------------------------------------------------

Public Sub Task_Sub1(ByVal goPackage As Object)

'oTask = goPackage.Tasks.New("DTSDataPumpTask")
oTask = CType(goPackage, DTS.Package).Tasks.New
("DTSDataPumpTask")

'oCustomTask1 = oTask.CustomTask
oCustomTask1 = CType(oTask.CustomTask, DTS.DataPumpTask2)


oCustomTask1.FastLoadOptions = CType(2,
DTS.DTSFastLoadOptions)
oCustomTask1.ExceptionFileOptions = CType(1,
DTS.DTSExceptionFileOptions)

'goPackage.Tasks.Add(oTask)
CType(goPackage, DTS.Package).Tasks.Add(oTask)

End Sub
'--------------------------------------------------------

Public Sub oCustomTask1_Trans_Sub1(ByVal oCustomTask1 As
Object)

'oTransformation = oCustomTask1.Transformations.New
("DTS.DataPumpTransformCopy")
oTransformation = CType(CType(oCustomTask1,
DTS.DataPumpTask2).Transformations.[New]
("DTS.DataPumpTransformCopy"), DTS.Transformation2)

'---here is where you deal with the data you are copying
'---and at the end of that is your last Cast/CType

'oCustomTask1.Transformations.Add(oTransformation)
CType(oCustomTask1,
DTS.DataPumpTask2).Transformations.Add(oTransforma tion)

'--End of Package
End Sub

HTH
Ron

Quote:
-----Original Message-----
Hi all!

I have created a dts package with SQL 2000 SP3a hotfix
818.
I saved it as bas file and imported in my VB.NET service;
I then fixed the small issues remaining with VB6->VB.NET
translations.
Quote:
The service compile file and works for a while than
crashes without notice.
The debugger says that there is no code line to show but
only assembly: seems to crash outside my code, somewhere
in the CLR !!!
Quote:
I then created a lot of breakpoints and found that the
problematic functions are:
Call oCustomTask1_Trans_SubXX(oCustomTask1)

where XX is everytime different ( I have 29
transformations ).

Can anyone give me an idea on how to identify the problem
and then fix it ?

Thank you in advance for any answer,

Simone




Reply With Quote
  #4  
Old   
Simone Chemelli
 
Posts: n/a

Default Re: Porting a bas DTS to VB.net: 99% success - 04-13-2005 , 05:06 PM



Thank you for both reply.

I changed my approach and now I load the DTS from file: everything works fine.

Regards,

Simone

"Simone Chemelli" <simone.chemelli.removethis (AT) serinf (DOT) it.nospam> wrote

Hi all!

I have created a dts package with SQL 2000 SP3a hotfix 818.
I saved it as bas file and imported in my VB.NET service; I then fixed the small issues remaining with VB6->VB.NET translations.
The service compile file and works for a while than crashes without notice.
The debugger says that there is no code line to show but only assembly: seems to crash outside my code, somewhere in the CLR !!!

I then created a lot of breakpoints and found that the problematic functions are:
Call oCustomTask1_Trans_SubXX(oCustomTask1)

where XX is everytime different ( I have 29 transformations ).

Can anyone give me an idea on how to identify the problem and then fix it ?

Thank you in advance for any answer,

Simone




Reply With Quote
  #5  
Old   
M D
 
Posts: n/a

Default Re: Porting a bas DTS to VB.net: 99% success - 04-19-2005 , 02:23 PM



Please elaborate "load DTS from file".

thx
md

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #6  
Old   
Darren Green
 
Posts: n/a

Default Re: Porting a bas DTS to VB.net: 99% success - 05-03-2005 , 11:39 AM



Instead of building the package from scratch in memory through code, just
load an existing pre-built package from a file on disk.


"M D" <mardukes (AT) aol (DOT) com> wrote

Quote:
Please elaborate "load DTS from file".

thx
md

*** Sent via Developersdex http://www.developersdex.com ***



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.