Const DATABASE As String = "C:\Documents and Settings\xp\My Documents\programing\โปรเจ็ค.mdb"
Dim strCon As String = "Provider = Microsoft.Jet.OLEDB.4.0;" & "Data Source =" & DATABASE
Dim cn As New OleDbConnection(strCon)
Dim strSQL As String = "select room_id,type_room,status from room"
Dim cm As New OleDbCommand(strSQL, cn)
Dim dr As OleDbDataReader
cn.Open()
dr = cm.ExecuteReader()
ListBox1.Items.Add("รหัสห้องพัก" & ControlChars.Tab & "ประเภทห้องพัก" & ControlChars.Tab & "สถานะ" & ControlChars.Tab)
Do While dr.Read()
Dim strRecord As String = dr.Item("room_id").ToString() & ControlChars.Tab & dr.Item("type_room").ToString() & ControlChars.Tab & ControlChars.Tab & dr.Item("status").ToString()
ListBox1.Items.Add(strRecord)
Loop
dr.Close()
cn.Close()