Advertisement
stevennathaniel

MS Access: Desain Sementara Multi Selection ListBox

Mar 9th, 2016
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.94 KB | None | 0 0
  1. Imports System.Data.OleDb
  2.  
  3. Imports System.Data
  4.  
  5. Imports Access = Microsoft.Office.Interop.Access
  6.  
  7. Imports Microsoft.Office
  8.  
  9.  
  10.  
  11. Public Class Form6
  12.  
  13.     Dim oledbKoneksi As OleDbConnection = New OleDbConnection
  14.  
  15.     Dim oledbPerintah As OleDbCommand = New OleDbCommand
  16.  
  17.     Dim lokasiFile As String = "D:\fileAccess\"
  18.  
  19.     Dim namaFile As String = "Database1.accdb"
  20.  
  21.     Dim stringKoneksi As String = "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=" & lokasiFile & namaFile & ";" & "Persist Security Info=False"
  22.  
  23.     Dim adapter As New OleDbDataAdapter
  24.  
  25.  
  26.     Private Sub Form6_Load(sender As Object, e As System.EventArgs) Handles Me.Load
  27.  
  28.         ListBox1.Items.Add("Kacang")
  29.  
  30.         ListBox1.Items.Add("Beras")
  31.  
  32.  
  33.         ListBox1.Sorted = True
  34.  
  35.         ListBox1.SelectionMode = SelectionMode.MultiExtended
  36.  
  37.         'ListBox1.SetSelected(0, True)
  38.  
  39.         'ListBox1.SetSelected(1, True)
  40.  
  41.  
  42.  
  43.  
  44.  
  45.     End Sub
  46. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement