Jumat, 04 November 2011

Latihan 33 Apkom 4 D4 A

40 komentar:

  1. dewi sartika
    461 09 045
    3a,d4


    Public NotInheritable Class form33a_46109045
    Dim dewi As New DataTable
    Dim dewi As New OleDb.OleDbCommand
    Dim sartika As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")

    Private Sub tambah_46109045_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah_46109045.Click
    If form33b_46109045.Visible = False Then
    form33b_46109045.Show()
    Else
    form33b_46109045.Activate()
    End If
    End Sub

    Private Sub edit_46109045_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_46109045.Click
    If form33b_46109045.Visible = False Then
    form33b_46109045.Show()
    Else
    form33b_46109045.Activate()
    End If
    form33b_46109045.kbl_46109045.Text = dgv_46109045.CurrentRow.Cells("kodebarang").Value
    form33b_46109045.kb_46109045.Text = dgv_46109045.CurrentRow.Cells("kodebarang").Value
    form33b_46109045.nb_46109045.Text = dgv_46109045.CurrentRow.Cells("namabarang").Value
    form33b_46109045.jb_46109045.Text = dgv_46109045.CurrentRow.Cells("jumlahbarang").Value
    form33b_46109045.hj_46109045.Text = dgv_46109045.CurrentRow.Cells("hargajual").Value
    End Sub

    Private Sub form33a_46109045_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select * from barang", sartika)
    dewi.Rows.Clear()
    adapter.Fill(dewi)
    adapter.Dispose()
    dgv_46109045.DataSource = dewi
    End Sub

    Private Sub hapus_46109045_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus_46109045.Click
    Dim ikha As String = "delete * from barang where kodebarang = '" & dgv_46109045.CurrentRow.Cells("kodebarang").Value & "'"
    dewi = New OleDb.OleDbCommand(ikha sartika)
    sartika.Open()
    dewi.ExecuteNonQuery()
    sartika.Close()
    dewi.Dispose()

    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select * from barang", sartika)
    dewi.Rows.Clear()
    adapter.Fill(dewi)
    adapter.Dispose()
    dgv_46109045.DataSource = dewi
    End Sub
    End Class

    BalasHapus
  2. Public NotInheritable Class form33b_46109045
    Dim chiko As New ByIskandar.CariKeDataBaseByIskandar
    Dim chiko As New OleDb.OleDbCommand
    Dim sartika As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If kbl_46109045.Text = "" Then
    chiko.AturPencarianDataBase("Barang", "KodeBarang", kb_46109045.Text, 1, sartika)
    If chiko.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    kb_46109045.Text = ""
    Exit Sub
    ElseIf kb_46109045.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf nb_46109045.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf hj_46109045.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf jb_46109045.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim ikha As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kb_46109045.Text & "','" & nb_46109045.Text & "'," & Val(hj_46109045.Text) & "," & Val(jb_46109045.Text) & ")"
    dewi = New OleDb.OleDbCommand(ikha, sartika)
    sartika.Open()
    dewi.ExecuteNonQuery()
    sartika.Close()
    dewi.Dispose()
    kb_46109045.Text = ""
    nb_46109045.Text = ""
    hj_46109045.Text = ""
    jb_46109045.Text = ""
    Else
    If kbl_46109045.Text <> kb_46109045.Text Then
    chiko.AturPencarianDataBase("Barang", "KodeBarang", kb_46109045.Text, 1, sartika)
    If chiko.JumlanBaris > 0 Then
    MsgBox("kode barang tidak dapat diupdate")
    Exit Sub
    End If
    End If
    If kb_46109045.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf nb_46109045.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf hj_46109045.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf jb_46109045.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim ikha As String = "update barang set kodebarang = '" & kb_46109045.Text & "', namabarang = '" & nb_46109045.Text & "', hargajual = " & Val(hj_46109045.Text) & ", jumlahbarang = " & Val(jb_46109045.Text) & " where kodebarang = '" & kbl_46109045.Text & "'"
    dewi = New OleDb.OleDbCommand(ikha, sartika)
    sartika.Open()
    dewi.ExecuteNonQuery()
    sartika.Close()
    dewi.Dispose()
    kbl_46109045.Text = "-"
    kb_46109045.Text = ""
    nb_46109045.Text = ""
    hj_46109045.Text = ""
    jb_46109045.Text = ""
    End If
    End Sub
    End Class

    BalasHapus
  3. Public Class Latihan33B_46109001
    Dim dwitya As New OleDb.OleDbCommand
    Dim saadah As New ByIskandar.CariKeDataBaseByIskandar
    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")

    Private Sub S46109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109001.Click
    If KB46109001.Text.Length = 0 Then
    MsgBox("Isi yang kosong")
    Exit Sub
    End If

    If NB46109001.Text.Length = 0 Then
    MsgBox("Isi yang kosong")
    Exit Sub
    End If

    If Val(HJ46109001.Text) = 0 Then
    MsgBox("Isi yang kosong")
    Exit Sub
    End If

    If Val(JB46109001.Text) = 0 Then
    MsgBox("Isi yang kosong")
    Exit Sub
    End If


    saadah.AturPencarianDataBase("Barang", "KodeBarang", KB46109001.Text, 1, conect)
    If saadah.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada ")
    Exit Sub
    End If

    dwitya = New OleDb.OleDbCommand("update barang set kodebarang = '" & KB46109001.Text & "', namabarang = '" & NB46109001.Text & "', hargajual = " & Val(HJ46109001.Text) & ", jumlahbarang = " & Val(JB46109001.Text) & " where kodebarang = '" & KKB46109001.Text & "'", conect)

    conect.Open()
    dwitya.ExecuteNonQuery()
    conect.Close()
    dwitya.Dispose()

    KB46109001.Text = ""
    NB46109001.Text = ""
    HJ46109001.Text = ""
    JB46109001.Text = ""
    KKB46109001.Text = "-"
    End Sub
    End Class

    BalasHapus
  4. Public Class Latihan34A_46109001
    Private Sub DaftarBarangToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
    If Latihan34B_46109001.Visible = False Then
    Latihan34B_46109001.MdiParent = Me
    Latihan34B_46109001.Show()
    Else
    Latihan34B_46109001.Activate()
    End If
    End Sub
    Private Sub DB46109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DB46109001.Click
    If Latihan34B_46109001.Visible = False Then
    Latihan34B_46109001.MdiParent = Me
    Latihan34B_46109001.Show()
    Else
    Latihan34B_46109001.Activate()
    End If
    End Sub

    Private Sub IB46109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IB46109001.Click
    If Latihan34C_46109001.Visible = False Then
    Latihan34C_46109001.MdiParent = Me
    Latihan34C_46109001.Show()
    Else
    Latihan34C_46109001.Activate()
    End If
    End Sub

    Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click

    If Latihan34C_46109001.Visible = False Then
    Latihan34C_46109001.MdiParent = Me
    Latihan34C_46109001.Show()
    Else
    Latihan34C_46109001.Activate()
    End If
    End Sub
    End Class

    BalasHapus
  5. Public Class LATIHAN033A_46109008
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=46109008")
    Dim cari As New DataTable
    Public Sub ambildata()
    Dim data As New OleDb.OleDbDataAdapter
    data = New OleDb.OleDbDataAdapter("select * from barang", conect)
    cari.Rows.Clear()
    data.Fill(cari)
    data.Dispose()
    End Sub
    Private Sub Latihan33_A_46109008_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ambildata()
    DGV_46109008.DataSource = cari
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2_46109008.Click
    If LATIHAN033B_46109008.Visible = False Then
    LATIHAN033B_46109008.Show()
    Else
    LATIHAN033B_46109008.Activate()
    End If
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_46109008.Click
    If LATIHAN033B_46109008.Visible = False Then
    LATIHAN033B_46109008.Show()
    Else
    LATIHAN033B_46109008.Activate()
    End If
    LATIHAN033B_46109008.KB.Text = DGV_46109008.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN033B_46109008.KB_46109008.Text = DGV_46109008.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN033B_46109008.NB_46109008.Text = DGV_46109008.CurrentRow.Cells("NAMABARANG").Value
    LATIHAN033B_46109008.HJ_46109008.Text = DGV_46109008.CurrentRow.Cells("HARGAJUAL").Value
    LATIHAN033B_46109008.JB_46109008.Text = DGV_46109008.CurrentRow.Cells("JUMLAHBARANG").Value
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3_46109008.Click
    Dim shoell As New OleDb.OleDbCommand
    shoell = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DGV_46109008.CurrentRow.Cells("KODEBARANG").Value & "'", conect)
    conect.Open()
    shoell.ExecuteNonQuery()
    conect.Close()
    shoell.Dispose()
    ambildata()
    End Sub
    End Class

    BalasHapus
  6. Public Class LATIHAN033B_46109008
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=46109008")
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_46109008.Click

    If KB_46109008.Text.Length = 0 Then
    MsgBox("maaf kode barang belum terisi")
    Exit Sub
    End If

    If NB_46109008.Text.Length = 0 Then
    MsgBox("maaf nama barang belum terisi")
    Exit Sub
    End If

    If Val(HJ_46109008.Text) = 0 Then
    MsgBox("maaf harga jual belum diisi")
    Exit Sub
    End If

    If Val(JB_46109008.Text) = 0 Then
    MsgBox("jumlah barang")
    Exit Sub
    End If

    cari.AturPencarianDataBase("barang", "kodebarang", KB_46109008.Text, 1, conect)

    If cari.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If


    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & KB_46109008.Text & "','" & NB_46109008.Text & "'," & Val(HJ_46109008.Text) & "," & Val(JB_46109008.Text) & ")", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    KB_46109008.Text = ""
    NB_46109008.Text = ""
    HJ_46109008.Text = ""
    JB_46109008.Text = ""

    LATIHAN033A_46109008.ambildata()
    End Sub

    Private Sub Latihan33_B_46109008_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
    End Class

    BalasHapus
  7. Public NotInheritable Class Form33B
    Dim DAUDE As New ByIskandar.CariKeDataBaseByIskandar
    Dim FADILLAH As New OleDb.OleDbCommand
    Dim SAGENA As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If DILA1_46109059.Text = "" Then
    DAUDE.AturPencarianDataBase("Barang", "KodeBarang", DILA2_46109059.Text, 1, SAGENA)
    If DAUDE.Jumlahbaris > 0 Then
    MsgBox("kode barang telah ada")
    DILA2_46109059.Text = ""
    Exit Sub
    ElseIf DILA2_46109059.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf DILA3_46109059.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf DILA5_46109059.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf DILA4_46109059.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim DILA As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & DILA2_46109059.Text & "','" & DILA3_46109059.Text & "'," & Val(DILA5_46109059.Text) & "," & Val(DILA4_46109059.Text) & ")"
    FADILLAH = New OleDb.OleDbCommand(DILA, SAGENA)
    SAGENA.Open()
    FADILLAH.ExecuteNonQuery()
    SAGENA.Close()
    FADILLAH.Dispose()
    DILA2_46109059.Text = ""
    DILA3_46109059.Text = ""
    DILA5_46109059.Text = ""
    DILA4_46109059.Text = ""
    Else
    If DILA1_46109059.Text <> DILA2_46109059.Text Then
    DAUDE.AturPencarianDataBase("Barang", "KodeBarang", DILA2_46109059.Text, 1, SAGENA)
    If DAUDE.JumlaDILA3aris > 0 Then
    MsgBox("kode barang tidak dapat diupdate")
    Exit Sub
    End If
    End If
    If DILA2_46109059.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf DILA3_46109059.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf DILA5_46109059.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf DILA4_46109059.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim DILA As String = "update barang set kodebarang = '" & DILA2_46109059.Text & "', namabarang = '" & DILA3_46109059.Text & "', hargajual = " & Val(DILA5_46109059.Text) & ", jumlahbarang = " & Val(DILA4_46109059.Text) & " where kodebarang = '" & DILA1_46109059.Text & "'"
    FADILLAH = New OleDb.OleDbCommand(DILA, SAGENA)
    SAGENA.Open()
    FADILLAH.ExecuteNonQuery()
    SAGENA.Close()
    FADILLAH.Dispose()
    DILA1_46109059.Text = "-"
    DILA2_46109059.Text = ""
    DILA3_46109059.Text = ""
    DILA5_46109059.Text = ""
    DILA4_46109059.Text = ""
    End If
    End Sub
    End Class

    BalasHapus
  8. Public NotInheritable Class form33b_46109053
    Dim saenong As New ByIskandar.CariKeDataBaseByIskandar
    Dim indah As New OleDb.OleDbCommand
    Dim yani As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If kbl_46109053.Text = "" Then
    saenong.AturPencarianDataBase("Barang", "KodeBarang", kb_46109053.Text, 1, yani)
    If saenong.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    kb_46109053.Text = ""
    Exit Sub
    ElseIf kb_46109053.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf nb_46109053.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf hj_46109053.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf jb_46109053.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim sae As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kb_46109053.Text & "','" & nb_46109053.Text & "'," & Val(hj_46109053.Text) & "," & Val(jb_46109053.Text) & ")"
    indah = New OleDb.OleDbCommand(sae, yani)
    yani.Open()
    indah.ExecuteNonQuery()
    yani.Close()
    indah.Dispose()
    kb_46109053.Text = ""
    nb_46109053.Text = ""
    hj_46109053.Text = ""
    jb_46109053.Text = ""
    Else
    If kbl_46109053.Text <> kb_46109053.Text Then
    saenong.AturPencarianDataBase("Barang", "KodeBarang", kb_46109053.Text, 1, yani)
    If saenong.JumlanBaris > 0 Then
    MsgBox("kode barang tidak dapat diupdate")
    Exit Sub
    End If
    End If
    If kb_46109053.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf nb_46109053.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf hj_46109053.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf jb_46109053.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim sae As String = "update barang set kodebarang = '" & kb_46109053.Text & "', namabarang = '" & nb_46109053.Text & "', hargajual = " & Val(hj_46109053.Text) & ", jumlahbarang = " & Val(jb_46109053.Text) & " where kodebarang = '" & kbl_46109053.Text & "'"
    indah = New OleDb.OleDbCommand(sae, yani)
    yani.Open()
    indah.ExecuteNonQuery()
    yani.Close()
    indah.Dispose()
    kbl_46109053.Text = "-"
    kb_46109053.Text = ""
    nb_46109053.Text = ""
    hj_46109053.Text = ""
    jb_46109053.Text = ""
    End If
    End Sub
    End Class

    BalasHapus
  9. Komentar ini telah dihapus oleh pengarang.

    BalasHapus
  10. Public Class LATIHAN033A46109017

    Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=putri")
    Dim Browse As New DataTable

    Public Sub wandika()
    Dim ayu As New OleDb.OleDbDataAdapter
    ayu = New OleDb.OleDbDataAdapter("select * from barang", CONECT)
    Browse.Rows.Clear()
    ayu.Fill(Browse)
    ayu.Dispose()

    End Sub

    Private Sub LATIHAN033A46109017_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    wandika()
    DataGridView1.DataSource = Browse
    End Sub

    Private Sub Button246109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button246109017.Click
    If LATIHAN033B46109017.Visible = False Then
    LATIHAN033B46109017.Show()
    Else
    LATIHAN033B46109017.Activate()
    End If
    End Sub

    Private Sub Button146109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button146109017.Click
    If LATIHAN033B46109017.Visible = False Then
    LATIHAN033B46109017.Show()
    Else
    LATIHAN033B46109017.Activate()
    End If

    LATIHAN033B46109017.KB.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN033B46109017.t146109017.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN033B46109017.t246109017.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value
    LATIHAN033B46109017.t346109017.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value
    LATIHAN033B46109017.t446109017.Text = DataGridView1.CurrentRow.Cells("JUMLAHBARANG").Value

    End Sub

    Private Sub Button346109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button346109017.Click
    Dim putri As New OleDb.OleDbCommand
    putri = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DataGridView1.CurrentRow.Cells("KODEBARANG").Value & "'", CONECT)
    CONECT.Open()
    putri.ExecuteNonQuery()
    CONECT.Close()
    putri.Dispose()

    wandika()

    End Sub
    End Class

    BalasHapus
  11. Public Class LATIHAN033B46109017
    Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=putri")
    Dim browse As New ByIskandar.CariKeDataBaseByIskandar

    Private Sub Button146109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button146109017.Click

    If t146109017.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t246109017.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t346109017.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t446109017.Text) = 0 Then
    MsgBox("jumlah barang")
    Exit Sub
    End If

    browse.AturPencarianDataBase("barang", "kodebarang", t146109017.Text, 1, CONECT)

    If browse.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t146109017.Text & "','" & t246109017.Text & "'," & Val(t346109017.Text) & "," & Val(t446109017.Text) & ")", CONECT)

    CONECT.Open()
    com.ExecuteNonQuery()
    CONECT.Close()
    com.Dispose()

    t146109017.Text = ""
    t246109017.Text = ""
    t346109017.Text = ""
    t446109017.Text = ""

    LATIHAN033A46109017.wandika()
    End Sub

    End Class

    BalasHapus
  12. Tugas Ahmad Syukri Ardiansya(46109040)

    http://tugas46109040.blogspot.com/2011/11/latihan-33apkom.html

    BalasHapus
  13. nama ; febiana fransiskus
    stmbk : 46109027

    Public NotInheritable Class LATIHAN33a_46109027
    Dim FEBIANA As New DataTable
    Dim FF As New OleDb.OleDbCommand
    Dim ana As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")

    Private Sub tambah_46109027_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah_46109027.Click
    If LATIHAN33b_46109027.Visible = False Then
    LATIHAN33b_46109027.Show()
    Else
    LATIHAN33b_46109027.Activate()
    End If
    End Sub

    Private Sub edit_46109027_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_46109027.Click
    If LATIHAN33b_46109027.Visible = False Then
    LATIHAN33b_46109027.Show()
    Else
    LATIHAN33b_46109027.Activate()
    End If
    LATIHAN33b_46109027.KBL_46109027.Text = dgv_46109027.CurrentRow.Cells("kodebarang").Value
    LATIHAN33b_46109027.KB_46109027.Text = dgv_46109027.CurrentRow.Cells("kodebarang").Value
    LATIHAN33b_46109027.NB_46109027.Text = dgv_46109027.CurrentRow.Cells("namabarang").Value
    LATIHAN33b_46109027.JB_46109027.Text = dgv_46109027.CurrentRow.Cells("jumlahbarang").Value
    LATIHAN33b_46109027.HJ_46109027.Text = dgv_46109027.CurrentRow.Cells("hargajual").Value
    End Sub

    Private Sub LATIHAN33a_46109027_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select * from barang", ana)
    FEBIANA.Rows.Clear()
    adapter.Fill(FEBIANA)
    adapter.Dispose()
    dgv_46109027.DataSource = FEBIANA
    End Sub

    Private Sub hapus_46109027_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus_46109027.Click
    Dim FEBY As String = "delete * from barang where kodebarang = '" & dgv_46109027.CurrentRow.Cells("kodebarang").Value & "'"
    FF = New OleDb.OleDbCommand(FEBY, ana)
    ana.Open()
    FF.ExecuteNonQuery()
    ana.Close()
    FF.Dispose()

    Dim adapter As New OleDb.OleDbDataAdapter
    adapter = New OleDb.OleDbDataAdapter("select * from barang", ana)
    FEBIANA.Rows.Clear()
    adapter.Fill(FEBIANA)
    adapter.Dispose()
    dgv_46109027.DataSource = FEBIANA
    End Sub
    End Class

    BalasHapus
  14. nama :febiana fransiskus
    stmbk : 46109027

    Public NotInheritable Class LATIHAN33b_46109027
    Dim fransiskus As New ByIskandar.CariKeDataBaseByIskandar
    Dim FEBIANA As New OleDb.OleDbCommand
    Dim ana As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If KBL_46109027.Text = "" Then
    fransiskus.AturPencarianDataBase("Barang", "KodeBarang", KB_46109027.Text, 1, ana)
    If fransiskus.JumlaNBaris > 0 Then
    MsgBox("kode barang telah ada")
    KB_46109027.Text = ""
    Exit Sub
    ElseIf KB_46109027.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf NB_46109027.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf HJ_46109027.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf JB_46109027.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim FEBY As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & KB_46109027.Text & "','" & NB_46109027.Text & "'," & Val(HJ_46109027.Text) & "," & Val(JB_46109027.Text) & ")"
    FEBIANA = New OleDb.OleDbCommand(FEBY, ana)
    ana.Open()
    FEBIANA.ExecuteNonQuery()
    ana.Close()
    FEBIANA.Dispose()
    KB_46109027.Text = ""
    NB_46109027.Text = ""
    HJ_46109027.Text = ""
    JB_46109027.Text = ""
    Else
    If KBL_46109027.Text <> KB_46109027.Text Then
    fransiskus.AturPencarianDataBase("Barang", "KodeBarang", KB_46109027.Text, 1, ana)
    If fransiskus.JumlaNBaris > 0 Then
    MsgBox("kode barang tidak dapat diupdate")
    Exit Sub
    End If
    End If
    If KB_46109027.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf NB_46109027.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf HJ_46109027.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf JB_46109027.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim FEBY As String = "update barang set kodebarang = '" & KB_46109027.Text & "', namabarang = '" & NB_46109027.Text & "', hargajual = " & Val(HJ_46109027.Text) & ", jumlahbarang = " & Val(JB_46109027.Text) & " where kodebarang = '" & KBL_46109027.Text & "'"
    FEBIANA = New OleDb.OleDbCommand(FEBY, ana)
    ana.Open()
    FEBIANA.ExecuteNonQuery()
    ana.Close()
    FEBIANA.Dispose()
    KBL_46109027.Text = "-"
    KB_46109027.Text = ""
    NB_46109027.Text = ""
    HJ_46109027.Text = ""
    JB_46109027.Text = ""
    End If
    End Sub
    End Class

    BalasHapus
  15. wahdaniah
    46109051


    LATIHAN33A_46109051
    Public Class LATIHAN33A_46109051
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=WAHDANIAH")
    Dim cari As New DataTable
    Public Sub ambildata()
    Dim data As New OleDb.OleDbDataAdapter
    data = New OleDb.OleDbDataAdapter("select * from barang", conect)
    cari.Rows.Clear()
    data.Fill(cari)
    data.Dispose()
    End Sub
    Private Sub LATIHAN33A_46109051_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ambildata()
    dg46109051.DataSource = cari
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    If LATIHAN33B_46109051.Visible = False Then
    LATIHAN33B_46109051.Show()
    Else
    LATIHAN33B_46109051.Activate()
    End If
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If LATIHAN33B_46109051.Visible = False Then
    LATIHAN33B_46109051.Show()
    Else
    LATIHAN33B_46109051.Activate()
    End If
    LATIHAN33B_46109051.KB.Text = dg46109051.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN33B_46109051.TB146109051.Text = dg46109051.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN33B_46109051.TB246109051.Text = dg46109051.CurrentRow.Cells("NAMABARANG").Value
    LATIHAN33B_46109051.TB346109051.Text = dg46109051.CurrentRow.Cells("HARGAJUAL").Value
    LATIHAN33B_46109051.TB446109051.Text = dg46109051.CurrentRow.Cells("JUMLAHBARANG").Value
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Dim ANI As New OleDb.OleDbCommand
    ANI = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & dg46109051.CurrentRow.Cells("KODEBARANG").Value & "'", conect)
    conect.Open()
    ANI.ExecuteNonQuery()
    conect.Close()
    ANI.Dispose()
    ambildata()
    End Sub
    End Class

    BalasHapus
  16. LATIHAN33B_46109051
    Public Class LATIHAN33B_46109051
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=WAHDANIAH")
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    If TB146109051.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If TB246109051.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(TB346109051.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(TB446109051.Text) = 0 Then
    MsgBox("jumlah barang")
    Exit Sub
    End If

    cari.AturPencarianDataBase("barang", "kodebarang", TB146109051.Text, 1, conect)

    If cari.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & TB146109051.Text & "','" & TB246109051.Text & "'," & Val(TB346109051.Text) & "," & Val(TB446109051.Text) & ")", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    TB146109051.Text = ""
    TB246109051.Text = ""
    TB346109051.Text = ""
    TB446109051.Text = ""

    LATIHAN33A_46109051.ambildata()
    End Sub
    End Class

    BalasHapus
  17. http://ildayani.blogspot.com/2012/10/latihan33a46110002.html

    http://ildayani.blogspot.com/2012/10/latihan33b46110002.html

    BalasHapus
  18. http://srikartikafanty.blogspot.com/2012/10/latihan33a46110007.html
    http://srikartikafanty.blogspot.com/2012/10/latihan33b46110007.html

    BalasHapus
  19. http://wahyunirachman.blogspot.com/2012/10/latihan33a46110020.html

    http://wahyunirachman.blogspot.com/2012/10/latihan33b46110020.html

    BalasHapus
  20. http://alfaega.blogspot.com/2012/10/latihan33a46110022.html

    http://alfaega.blogspot.com/2012/10/latihan33b46110022.html

    BalasHapus
  21. http://hanihasan07.blogspot.com/2012/10/latihan33a46110044.html
    http://hanihasan07.blogspot.com/2012/10/latihan33b46110044.html

    BalasHapus
  22. http://idhamsyaam.blogspot.com/2012/10/latihan3346110021.html

    BalasHapus
  23. http://sulhihusni.blogspot.com/2012/10/latihan33a46110004.html
    http://sulhihusni.blogspot.com/2012/10/latihan33b46110004.html

    BalasHapus
  24. http://restyaccounting.blogspot.com/2012/10/latihan33a46110027.html
    http://restyaccounting.blogspot.com/2012/10/latihan33b46110027.html

    BalasHapus
  25. http://amalmaulana92.blogspot.com/2012/10/llatihan33a46110003.html

    http://amalmaulana92.blogspot.com/2012/10/latihan33b46110003.html

    BalasHapus
  26. http://diyanahdina.blogspot.com/2012/10/latihan33a46110045.html

    http://diyanahdina.blogspot.com/2012/10/latihan33b46110045.html

    BalasHapus
  27. http://mulyawarman039.blogspot.com/2012/10/latihan33a46110039.html
    http://mulyawarman039.blogspot.com/2012/10/latihan33b46110039.html

    BalasHapus
  28. http://dianmegariski.blogspot.com/2012/10/latihan33a46110023_13.html

    http://dianmegariski.blogspot.com/2012/10/latihan33b46110023_4772.html

    BalasHapus
  29. http://feibyfrycilia.blogspot.com/2012/10/latihan33a46110055.html
    http://feibyfrycilia.blogspot.com/2012/10/latihan33b46110055.html

    BalasHapus
  30. http://fitrianihamka.blogspot.com/2012/10/latihan33a46110006.html
    http://fitrianihamka.blogspot.com/2012/10/latihan33b46110006.html

    BalasHapus
  31. http://muthmil8.blogspot.com/2012/10/latihan33adan33b46110037.html

    BalasHapus
  32. http://bahrizj.blogspot.com/2012/10/latihan3346110001.html

    BalasHapus
  33. http://bothbon.blogspot.com/2012/10/latihan33a46110043.html
    http://bothbon.blogspot.com/2012/10/latihan33b46110043.html

    BalasHapus
  34. http://aardianzah2.blogspot.com/2012/10/latihan-33a.html
    http://aardianzah2.blogspot.com/2012/10/latihan-33b.html

    BalasHapus
  35. http://rafidashaleh.blogspot.com/2012/10/latihan33a46110041.html
    http://rafidashaleh.blogspot.com/2012/10/latihan33b46110041.html

    BalasHapus

  36. http://cacalisa.blogspot.com/2012/10/latihan33a46110038.html
    http://cacalisa.blogspot.com/2012/10/latihan33b46110038.html

    BalasHapus
  37. http://yuliaasrida427.blogspot.com/2012/10/latihan33a46110009.html
    http://yuliaasrida427.blogspot.com/2012/10/latihan33b46110009.html

    BalasHapus
  38. http://masdarwati.blogspot.com/2012/10/latihan33a46110024.html
    http://masdarwati.blogspot.com/2012/10/latihan33b46110024.html

    BalasHapus
  39. http://bahrizj.blogspot.com/2012/10/normal-0-false-false-false-en-us-x-none.html

    BalasHapus
  40. http://deodns.blogspot.com/#!/2013/01/latihan33a46110040.html
    http://deodns.blogspot.com/#!/2013/01/latihan33b46110040.html

    BalasHapus