Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports System.Data.OleDb
Public Class ScriptMain
Inherits UserComponent
Dim DBReader As OleDbDataReader
Dim DBConn As OleDbConnection
Dim DBCommand As OleDbCommand
Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
Dim ConnString As String = Me.Connections.郁屋.ConnectionString
DBConn = New OleDbConnection(ConnString)
DBConn.Open()
End Sub
Public Overrides Sub PreExecute()
DBCommand = New OleDbCommand("select * frmo TableA", DBConn)
DBReader = DBCommand.ExecuteReader()
End Sub
Public Overrides Sub PostExecute()
DBReader.Close()
End Sub
Public Overrides Sub CreateNewOutputRows()
'
' Add rows by calling AddRow method on member variable called "<Output Name>Buffer"
' E.g., MyOutputBuffer.AddRow() if your output was named "My Output"
'
Dim sLog() As String
Dim sItem() As String
Dim sTemp As String
Dim i As Integer
Do While DBReader.Read
With 豢0Buffer
.AddRow()
.AccountID = DBReader.GetString(0)
.RegDT = DBReader.GetDateTime(1)
.sArray = DBReader.GetString(2)
End With
sLog = DBReader.GetString(2).Split(CChar(","))
For i = 0 To sLog.Length - 1
sItem = sTemp.Split(CChar("."))
With 危Buffer
.AddRow()
.AccountID = DBReader.GetString(0)
.Item1 = sItem(0)
.Item2 = sItem(1)
.Item3 = sItem(2)
.Item4 = sItem(3)
.ITem5 = sItem(4)
End With
Next
Loop
End Sub
Public Sub New()
End Sub
End Class