_대문 | 방명록 | 최근글 | 홈피소개 | 주인놈
FrontPage › SSIS-OLEDB원본

Contents

[-]


OLEDB 원본
  1. Imports System
  2. Imports System.Data
  3. Imports System.Math
  4. Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
  5. Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
  6. Imports System.Data.OleDb
  7.  
  8. Public Class ScriptMain
  9. Inherits UserComponent
  10.  
  11. Dim DBReader As OleDbDataReader
  12. Dim DBConn As OleDbConnection
  13. Dim DBCommand As OleDbCommand
  14.  
  15. Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
  16.  
  17. Dim ConnString As String = Me.Connections.연결.ConnectionString
  18. DBConn = New OleDbConnection(ConnString)
  19. DBConn.Open()
  20.  
  21. End Sub
  22.  
  23. Public Overrides Sub PreExecute()
  24.  
  25. DBCommand = New OleDbCommand("select * frmo TableA", DBConn)
  26. DBReader = DBCommand.ExecuteReader()
  27.  
  28. End Sub
  29.  
  30. Public Overrides Sub PostExecute()
  31.  
  32. DBReader.Close()
  33.  
  34. End Sub
  35.  
  36. Public Overrides Sub CreateNewOutputRows()
  37. '
  38. ' Add rows by calling AddRow method on member variable called "<Output Name>Buffer"
  39. ' E.g., MyOutputBuffer.AddRow() if your output was named "My Output"
  40. '
  41. Dim sLog() As String
  42. Dim sItem() As String
  43. Dim sTemp As String
  44. Dim i As Integer
  45.  
  46. Do While DBReader.Read
  47.  
  48. With 출력0Buffer
  49. .AddRow()
  50. .AccountID = DBReader.GetString(0)
  51. .RegDT = DBReader.GetDateTime(1)
  52. .sArray = DBReader.GetString(2)
  53. End With
  54.  
  55. sLog = DBReader.GetString(2).Split(CChar(","))
  56.  
  57.  
  58. For i = 0 To sLog.Length - 1
  59. sItem = sTemp.Split(CChar("."))
  60. With 아이템Buffer
  61. .AddRow()
  62. .AccountID = DBReader.GetString(0)
  63. .Item1 = sItem(0)
  64. .Item2 = sItem(1)
  65. .Item3 = sItem(2)
  66. .Item4 = sItem(3)
  67. .ITem5 = sItem(4)
  68. End With
  69. Next
  70. Loop
  71.  
  72. End Sub
  73.  
  74. Public Sub New()
  75.  
  76. End Sub
  77.  
  78. End Class
  79.  
* IE���� �ҽ� ����� �ٹٲ� �ȵ�. MS-Word � �ٿ� ��������. �ٹٲ� �Ǵ� ������: Chrome, Opera, Safari

댓글 남기기..
이름: : 오른쪽의 새로고침을 클릭해 주세요. 새로고침
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:52

사람은 누구나 자기에게 들리는 음악에 걸음을 맞춰야 한다. (H.D. 소로우)