#title SSIS - ODBC 원본 스크립트 원본 예제 {{{ Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper Imports Microsoft.SqlServer.Dts.Runtime.Wrapper Imports system.Data.Odbc Imports System.Text Public Class ScriptMain Inherits UserComponent Dim odbcConn As OdbcConnection Dim odbcCmd As OdbcCommand Dim odbcParam As OdbcParameter Dim odbcReader As OdbcDataReader Public Overrides Sub AcquireConnections(ByVal Transaction As Object) Dim connectionString As String connectionString = Me.Connections.연결.ConnectionString odbcConn = New OdbcConnection(connectionString) odbcConn.Open() End Sub Public Overrides Sub PreExecute() Dim odbcCmd As New OdbcCommand("select country, city, name cityname, state from citybycountry;", odbcConn) odbcReader = odbcCmd.ExecuteReader End Sub Public Overrides Sub CreateNewOutputRows() ' ' Add rows by calling AddRow method on member variable called "Buffer" ' E.g., MyOutputBuffer.AddRow() if your output was named "My Output" ' Do While odbcReader.Read With 출력0Buffer .AddRow() .country = odbcReader.GetString(0) .city = odbcReader.GetString(1) .cityname = odbcReader.GetString(2) .state = odbcReader.GetString(3) End With Loop End Sub Public Overrides Sub PostExecute() odbcReader.Close() End Sub Public Overrides Sub ReleaseConnections() Me.Connections.연결.ReleaseConnection(odbcConn) End Sub End Class }}}