ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文
【VB.NET】COM経由の OO4O による Oracle 参照 ( No.2 )
日時: 2008/05/19 15:24
名前: lightbox







Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click

	Dim Session As OracleInProcServer.OraSessionClass = New OracleInProcServer.OraSessionClass()
	Dim Cn As OracleInProcServer.OraDatabase

	Cn = Session.OpenDatabase("night/XE", "lightbox/lightbox", 0)

	Dim Rs As OracleInProcServer.OraDynaset
	Rs = Cn.CreateDynaset("select * from 商品分類マスタ", 2)

	Dim Buffer As String = ""
	Do While Not Rs.EOF
		For i As Integer = 0 To Rs.Fields.Count - 1
			If i <> 0 Then
				Buffer &= ","
			End If
			Buffer &= Rs.Fields(i).Value
		Next
		Buffer &= ControlChars.CrLf
		Rs.MoveNext()
	Loop

	MessageBox.Show(Buffer)

End Sub