Jumat, 04 November 2011

Latihan 34 Apkom 4 D4 A

50 komentar:

  1. dewi sartika
    461 09 045
    3a.d4


    Public Class form34a_46109045

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

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

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

    Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click
    If form34c_46109045.Visible = False Then
    form34c_46109045.MdiParent = Me
    form34c_46109045.Show()
    Else
    form34c_46109045.Activate()
    End If
    End Sub
    End Class

    BalasHapus
  2. Public NotInheritable Class form34c_46109045
    Dim chiko As New ByIskandar.CariKeDataBaseByIskandar
    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 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 sae 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()
    sartika.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 LATIHAN034A_46109008

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


    Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
    If Latihan034C_46109008.Visible = False Then
    Latihan034C_46109008.MdiParent = Me.MdiParent
    Latihan034C_46109008.Show()

    Else
    Latihan034C_46109008.Activate()
    End If
    End Sub

    Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripLabel1_46109008.Click
    If LATIHAN034B_46109008.Visible = False Then
    LATIHAN034B_46109008.MdiParent = Me.MdiParent
    LATIHAN034B_46109008.Show()

    Else
    LATIHAN034B_46109008.Activate()
    End If
    End Sub


    Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripLabel2_46109008.Click
    If LATIHAN034C_46109008.Visible = False Then
    LATIHAN034C_46109008.MdiParent = Me.MdiParent
    LATIHAN034C_46109008.Show()

    Else
    LATIHAN034C_46109008.Activate()
    End If
    End Sub


    End Class

    BalasHapus
  4. Public Class LATIHAN034B_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 dtab As New DataTable

    Public Sub ambildata()
    Dim adap As New OleDb.OleDbDataAdapter
    adap = New OleDb.OleDbDataAdapter("select * from barang", conect)
    dtab.Rows.Clear()
    adap.Fill(dtab)
    adap.Dispose()

    End Sub

    Private Sub latihan034B_46109008_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ambildata()
    DGV_46109008.DataSource = dtab
    End Sub

    Private Sub Button1_46109008_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1_46109008.Click
    If LATIHAN034C_46109008.Visible = False Then
    LATIHAN034C_46109008.Show()
    Else
    LATIHAN034C_46109008.Activate()
    End If
    LATIHAN034C_46109008.KB.Text = DGV_46109008.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN034C_46109008.KB_46109008.Text = DGV_46109008.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN034C_46109008.NB_46109008.Text = DGV_46109008.CurrentRow.Cells("NAMABARANG").Value
    LATIHAN034C_46109008.HJ_46109008.Text = DGV_46109008.CurrentRow.Cells("HARGAJUAL").Value
    LATIHAN034C_46109008.JB_46109008.Text = DGV_46109008.CurrentRow.Cells("JUMLAHBARANG").Value()
    End Sub

    Private Sub Button2_46109008_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2_46109008.Click
    If LATIHAN034C_46109008.Visible = False Then
    LATIHAN034C_46109008.Show()
    Else
    LATIHAN034C_46109008.Activate()
    End If
    End Sub
    End Class

    BalasHapus
  5. Public Class LATIHAN034C_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 TAMBAH()
    If KB_46109008.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

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

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

    If Val(JB_46109008.Text) = 0 Then
    MsgBox("JUMLAH BELUM TERISI")
    Exit Sub
    End If

    cari.AturPencarianDataBase("barang", "kode barang", 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 EDIT()
    If KB_46109008.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

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

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

    If Val(JB_46109008.Text) = 0 Then
    MsgBox("JUMLAH BELUM TERISI")
    Exit Sub
    End If

    If KB.Text <> KB_46109008.Text Then
    cari.AturPencarianDataBase("barang", "kode barang", KB_46109008.Text, 1, conect)

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

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("update barang set kodebarang ='" & KB_46109008.Text & "',namabarang='" & NB_46109008.Text & "',hargajual=" & Val(HJ_46109008.Text) & ", jumlahbarang=" & Val(JB_46109008.Text) & "where kodebarang='" & KB.Text & "'", conect)

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

    KB_46109008.Text = ""
    NB_46109008.Text = ""
    HJ_46109008.Text = ""
    JB_46109008.Text = ""
    KB.Text = "-"
    LATIHAN033A_46109008.ambildata()

    End Sub

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1_46109008.Click
    If KB.Text = "-" Then
    TAMBAH()
    Else
    EDIT()
    End If
    End Sub

    End Class

    BalasHapus
  6. Private Sub DEL_46109031_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles del_46109031.Click
    YANTI = New OleDb.OleDbCommand("delete * from barang where kodebarang = '" & dgv_46109031.CurrentRow.Cells("kodebarang").Value & "'", KONEKSI)
    KONEKSI.Open()
    YANTI.ExecuteNonQuery()
    KONEKSI.Close()
    YANTI.Dispose()

    INDRIYANTI()
    End Sub

    End Class

    BalasHapus
  7. Public Class Form34A

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

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

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

    Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click
    If Form34C.Visible = False Then
    Form34C.MdiParent = Me
    Form34C.Show()
    Else
    Form34C.Activate()
    End If
    End Sub
    End Class

    BalasHapus
  8. Public NotInheritable Class Form34C
    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
  9. nur ainun a.sadik
    461 09 030

    LATIHAN 34A

    Public Class LATIHAN034A_46109030


    Private Sub ToolStripLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles db_46109030.Click
    If LATIHAN034B_46109030.Visible = False Then
    LATIHAN034B_46109030.MdiParent = Me.MdiParent
    LATIHAN034B_46109030.Show()

    Else
    LATIHAN034B_46109030.Activate()
    End If
    End Sub


    Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ib_46109030.Click
    If LATIHAN034C_46109030.Visible = False Then
    LATIHAN034C_46109030.MdiParent = Me.MdiParent
    LATIHAN034C_46109030.Show()

    Else
    LATIHAN034C_46109030.Activate()
    End If
    End Sub

    Private Sub ts1_46109030_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ts1_46109030.Click
    If LATIHAN034B_46109030.Visible = False Then
    LATIHAN034B_46109030.MdiParent = Me.MdiParent
    LATIHAN034B_46109030.Show()

    Else
    LATIHAN034B_46109030.Activate()
    End If
    End Sub

    Private Sub ts2_46109030_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ts2_46109030.Click
    If LATIHAN034C_46109030.Visible = False Then
    LATIHAN034C_46109030.MdiParent = Me.MdiParent
    LATIHAN034C_46109030.Show()

    Else
    LATIHAN034C_46109030.Activate()
    End If
    End Sub
    End Class

    BalasHapus
  10. nur ainun a.sadik
    461 09 030

    LATIHAN 34C

    Public Class LATIHAN034C_46109030
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=015")
    Dim telusur As New ByIskandar.CariKeDataBaseByIskandar

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

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

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

    If Val(jb_46109030.Text) = 0 Then
    MsgBox("JUMLAH BELUM TERISI")
    Exit Sub
    End If

    telusur.AturPencarianDataBase("barang", "kode barang", kb_46109030.Text, 1, conect)

    If telusur.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_46109030.Text & "','" & nb_46109030.Text & "'," & Val(hj_46109030.Text) & "," & Val(jb_46109030.Text) & ")", conect)

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

    kb_46109030.Text = ""
    nb_46109030.Text = ""
    hj_46109030.Text = ""
    jb_46109030.Text = ""

    LATIHAN033A_46109030.ainun()
    End Sub

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

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

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

    If Val(jb_46109030.Text) = 0 Then
    MsgBox("JUMLAH BELUM TERISI")
    Exit Sub
    End If

    If KB.Text <> kb_46109030.Text Then
    telusur.AturPencarianDataBase("barang", "kode barang", kb_46109030.Text, 1, conect)

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


    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("update barang set kodebarang ='" & kb_46109030.Text & "',namabarang='" & nb_46109030.Text & "',hargajual=" & Val(hj_46109030.Text) & ", jumlahbarang=" & Val(jb_46109030.Text) & "where kodebarang='" & KB.Text & "'", conect)

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

    kb_46109030.Text = ""
    nb_46109030.Text = ""
    hj_46109030.Text = ""
    jb_46109030.Text = ""
    KB.Text = "-"
    End Sub

    Private Sub s_46109030_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles s_46109030.Click
    If KB.Text = "-" Then
    tambah()
    Else
    edit()
    End If
    End Sub
    End Class

    BalasHapus
  11. Public Class form34a_46109053

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

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

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

    Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click
    If form34c_46109053.Visible = False Then
    form34c_46109053.MdiParent = Me
    form34c_46109053.Show()
    Else
    form34c_46109053.Activate()
    End If
    End Sub
    End Class

    BalasHapus
  12. Public NotInheritable Class form34c_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
  13. Public Class form34a_46109023

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

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

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

    Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click
    If form34c_46109023.Visible = False Then
    form34c_46109023.MdiParent = Me
    form34c_46109023.Show()
    Else
    form34c_46109023.Activate()
    End If
    End Sub
    End Class

    BalasHapus
  14. Public NotInheritable Class form34c_46109023
    Dim cimi As New ByIskandar.CariKeDataBaseByIskandar
    Dim ismi As New OleDb.OleDbCommand
    Dim sri 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_46109023.Text = "" Then
    cimi.AturPencarianDataBase("Barang", "KodeBarang", kb_46109023.Text, 1, sartika)
    If cimi.JumlanBaris > 0 Then
    MsgBox("kode barang telah ada")
    kb_46109023.Text = ""
    Exit Sub
    ElseIf kb_46109023.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf nb_46109023.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf hj_461090235.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf jb_46109023.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim cimii As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kb_46109023.Text & "','" & nb_46109023.Text & "'," & Val(hj_46109023.Text) & "," & Val(jb_46109023.Text) & ")"
    ismi = New OleDb.OleDbCommand(cimii, sri)
    sri.Open()
    ismi.ExecuteNonQuery()
    sri.Close()
    sri.Dispose()
    kb_46109023.Text = ""
    nb_46109023.Text = ""
    hj_46109023.Text = ""
    jb_46109023.Text = ""
    Else
    If kbl_46109023.Text <> kb_46109023.Text Then
    cimi.AturPencarianDataBase("Barang", "KodeBarang", kb_46109023.Text, 1, sri)
    If cimi.JumlanBaris > 0 Then
    MsgBox("kode barang tidak dapat diupdate")
    Exit Sub
    End If
    End If
    If kb_46109023.Text.Length = 0 Then
    MsgBox("kode barang harus tercantum")
    Exit Sub
    ElseIf nb_46109023.Text.Length = 0 Then
    MsgBox("nama barang harus tercantum")
    Exit Sub
    ElseIf hj_46109023.Text.Length = 0 Then
    MsgBox("harga jual harus tercantum")
    Exit Sub
    ElseIf jb_46109023.Text.Length = 0 Then
    MsgBox("jumlah barang harus tercantum")
    Exit Sub
    End If
    Dim cimii As String = "update barang set kodebarang = '" & kb_46109023.Text & "', namabarang = '" & nb_46109023.Text & "', hargajual = " & Val(hj_46109023.Text) & ", jumlahbarang = " & Val(jb_46109023.Text) & " where kodebarang = '" & kbl_46109023.Text & "'"
    ismi = New OleDb.OleDbCommand(cimii, sri)
    sri.Open()
    ismi.ExecuteNonQuery()
    sri.Close()
    ismi.Dispose()
    kbl_46109023.Text = "-"
    kb_46109023.Text = ""
    nb_46109023.Text = ""
    hj_46109023.Text = ""
    jb_46109023.Text = ""
    End If
    End Sub
    End Class

    BalasHapus
  15. Tugas Ahmad Syukri Ardiansya(46109040)

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

    BalasHapus
  16. Public Class LATIHAN034A46109017
    Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
    If LATIHAN034B46109017.Visible = False Then
    LATIHAN034B46109017.MdiParent = Me.MdiParent
    LATIHAN034B46109017.Show()

    Else
    LATIHAN034B46109017.Activate() 'jika sdh muncul tp dibelakang
    End If

    End Sub

    Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
    If LATIHAN034C46109017.Visible = False Then
    LATIHAN034C46109017.MdiParent = Me.MdiParent
    LATIHAN034C46109017.Show()

    Else
    LATIHAN034C46109017.Activate() 'jika sdh muncul tp dibelakang
    End If

    End Sub

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
    If LATIHAN034B46109017.Visible = False Then
    LATIHAN034B46109017.MdiParent = Me.MdiParent
    LATIHAN034B46109017.Show()

    Else
    LATIHAN034B46109017.Activate() 'jika sdh muncul tp dibelakang
    End If
    End Sub

    Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
    If LATIHAN034C46109017.Visible = False Then
    LATIHAN034C46109017.MdiParent = Me.MdiParent
    LATIHAN034C46109017.Show()

    Else
    LATIHAN034C46109017.Activate() 'jika sdh muncul tp dibelakang
    End If
    End Sub

    End Class

    BalasHapus
  17. Public Class LATIHAN034B46109017

    'dekklarasi connection
    Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=nideria")
    'deklarasi tabel
    Dim ayu As New DataTable

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

    End Sub

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

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    If LATIHAN034C46109017.Visible = False Then
    LATIHAN034C46109017.Show()
    Else
    LATIHAN034C46109017.Activate() 'jika sdh muncul tp dibelakang
    End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If LATIHAN034C46109017.Visible = False Then
    LATIHAN034C46109017.Show()
    Else
    LATIHAN034C46109017.Activate() 'jika sdh muncul tp dibelakang
    End If
    LATIHAN034C46109017.KB.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN034C46109017.t146109017.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN034C46109017.t246109017.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value
    LATIHAN034C46109017.t346109017.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value
    LATIHAN034C46109017.t446109017.Text = DataGridView1.CurrentRow.Cells("JUMLAHBARANG").Value

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.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
  18. latihan 34C bisa dilihat di :

    http://ayuwandikaputriutami.blogspot.com/2011/11/latihan-34c.html

    BalasHapus
  19. nama : febiana fransiskus
    stmbk: 46109027

    Public Class LATIHAN34a_46109027

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

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

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

    Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click
    If LATIHAN34c_46109027.Visible = False Then
    LATIHAN34c_46109027.MdiParent = Me
    LATIHAN34c_46109027.Show()
    Else
    LATIHAN34c_46109027.Activate()
    End If
    End Sub
    End Class

    BalasHapus
  20. nama :febiana fransiskus
    stmbk : 46109027

    Public NotInheritable Class LATIHAN34c_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
  21. wahdaniah
    46109051


    LATIHAN34A_46109051
    Public Class LATIHAN34A_46109051

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


    Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
    If LATIHAN34C_46109051.Visible = False Then
    LATIHAN34C_46109051.MdiParent = Me.MdiParent
    LATIHAN34C_46109051.Show()

    Else
    LATIHAN34C_46109051.Activate()
    End If
    End Sub


    Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
    If LATIHAN34B_46109051.Visible = False Then
    LATIHAN34B_46109051.MdiParent = Me.MdiParent
    LATIHAN34B_46109051.Show()

    Else
    LATIHAN34B_46109051.Activate()
    End If
    End Sub


    Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
    If LATIHAN34C_46109051.Visible = False Then
    LATIHAN34C_46109051.MdiParent = Me.MdiParent
    LATIHAN34C_46109051.Show()

    Else
    LATIHAN34C_46109051.Activate()
    End If
    End Sub
    End Clas





    LATIHAN34B_46109051
    Public Class LATIHAN34B_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 wahda As New DataTable

    Public Sub ambildata()
    Dim nia As New OleDb.OleDbDataAdapter
    nia = New OleDb.OleDbDataAdapter("select * from barang", conect)
    wahda.Rows.Clear()
    nia.Fill(wahda)
    nia.Dispose()

    End Sub


    Private Sub LATIHAN34B_46109051_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ambildata()
    dg46109051.DataSource = Data
    End Sub


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


    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    If LATIHAN34C_46109051.Visible = False Then
    LATIHAN34C_46109051.Show()
    Else
    LATIHAN34C_46109051.Activate()
    End If
    LATIHAN34C_46109051.KB.Text = dg46109051.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN34C_46109051.TB146109051.Text = dg46109051.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN34C_46109051.TB246109051.Text = dg46109051.CurrentRow.Cells("NAMABARANG").Value
    LATIHAN34C_46109051.TB346109051.Text = dg46109051.CurrentRow.Cells("HARGAJUAL").Value
    LATIHAN34C_46109051.TB446109051.Text = dg46109051.CurrentRow.Cells("JUMLAHBARANG").Value()
    End Sub
    End Class

    BalasHapus
  22. LATIHAN34C_46109051
    Public Class LATIHAN34C_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 Tambah()
    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 BELUM TERISI")
    Exit Sub
    End If

    cari.AturPencarianDataBase("barang", "kode barang", TB146109051.Text, 1, conect)
    If cari.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If

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

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

    LATIHAN33A_46109051.ambildata()
    End Sub

    Private Sub EDIT()
    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 BELUM TERISI")
    Exit Sub
    End If

    If KB.Text <> TB146109051.Text Then
    cari.AturPencarianDataBase("barang", "kode barang", TB146109051.Text, 1, conect)

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

    Dim wahda As New OleDb.OleDbCommand
    wahda = New OleDb.OleDbCommand("update barang set kodebarang ='" & TB146109051.Text & "',namabarang='" & TB246109051.Text & "',hargajual=" & Val(TB346109051.Text) & ", jumlahbarang=" & Val(TB446109051.Text) & "where kodebarang='" & KB.Text & "'", conect)

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

    TB146109051.Text = ""
    TB246109051.Text = ""
    TB346109051.Text = ""
    TB446109051.Text = ""
    KB.Text = "-"
    LATIHAN33A_46109051.ambildata()

    End Sub

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    If KB.Text = "-" Then
    Tambah()
    Else
    EDIT()
    End If
    End Sub
    End Class

    BalasHapus
  23. tugasku 27-34


    http://arularva.blogspot.com/2011/11/tugas-27-34-muh-fahrul-46109005_20.html

    BalasHapus
  24. Public Class LATIHAN034C_041
    Dim parinding As New ByIskandar.CariKeDataBaseByIskandar
    Dim natalina As New OleDb.OleDbCommand
    Dim joice As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")

    Private Sub jui()
    If kb_041.Text.Length = 0 Then
    MsgBox("kode barang harus ada")
    Exit Sub
    End If

    If nb_041.Text.Length = 0 Then
    MsgBox("nama barang harus ada")
    Exit Sub
    End If

    If Val(hj_041.Text) = 0 Then
    MsgBox("harga jual harus ada")
    Exit Sub
    End If

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

    parinding.AturPencarianDataBase("barang", "kode barang", kb_041.Text, 1, joice)

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

    Dim paginta As New OleDb.OleDbCommand
    paginta = New OleDb.OleDbCommand("update barang set kodebarang='" & kb_041.Text & "',namabarang='" & nb_041.Text & "',hargajual=" & Val(hj_041.Text) & ",jumlahbarang=" & Val(jb_041.Text) & "where kodebarang='" & KB.Text & "'", joice)


    joice.Open()
    natalina.ExecuteNonQuery()
    joice.Close()
    natalina.Dispose()

    kb_041.Text = ""
    nb_041.Text = ""
    hj_041.Text = ""
    jb_041.Text = ""

    LATIHAN033A_041.jui()
    End Sub
    Private Sub edit()
    If kb_041.Text.Length = 0 Then
    MsgBox("kode barang harus ada")
    Exit Sub
    End If

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

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

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

    If kb.text <> nb_041.Text Then
    parinding.AturPencarianDataBase("barang", "kode barang", kb_041.Text, 1, joice)


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

    Dim paginta As New OleDb.OleDbCommand
    paginta = New OleDb.OleDbCommand("update barang set kodebarang='" & kb_041.Text & "',namabarang='" & nb_041.Text & "',hargajual=" & Val(hj_041.Text) & ",jumlahbarang=" & Val(jb_041.Text) & "where kodebarang='" & KB.Text & "'", joice)

    joice.Open()
    natalina.ExecuteNonQuery()
    joice.Close()
    natalina.Dispose()

    kb_041.Text = ""
    nb_041.Text = ""
    hj_041.Text = ""
    jb_041.Text = ""
    KB.Text = "_"

    LATIHAN033A_041.jui()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If KB.Text = "_" Then
    jui()
    Else
    edit()
    End If
    End Sub

    BalasHapus
  25. Public Class LATIHAN034A_054
    Private Sub TSL1_054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TSL1_054.Click
    If LATIHAN034B_054.Visible = False Then
    LATIHAN034B_054.MdiParent = Me.MdiParent
    LATIHAN034B_054.Show()

    Else
    LATIHAN034B_054.Activate()
    End If
    End Sub

    Private Sub TSL2_054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TSL2_054.Click
    If LATIHAN034C_054.Visible = False Then
    LATIHAN034C_054.MdiParent = Me.MdiParent
    LATIHAN034C_054.Show()

    Else
    LATIHAN034C_054.Activate()
    End If
    End Sub

    Private Sub ToolStripWw1_054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TSL2_054.Click
    If LATIHAN034B_054.Visible = False Then
    LATIHAN034B_054.MdiParent = Me.MdiParent
    LATIHAN034B_054.Show()

    Else
    LATIHAN034B_054.Activate()
    End If
    End Sub

    Private Sub ToolStripWw2_054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TSL2_054.Click
    If LATIHAN034C_054.Visible = False Then
    LATIHAN034C_054.MdiParent = Me.MdiParent
    LATIHAN034C_054.Show()

    Else
    LATIHAN034C_054.Activate()
    End If
    End Sub
    End Class

    BalasHapus
  26. Public Class LATIHAN034B_054
    Dim MUSTIKA As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=WIWI")
    Dim cari As New DataTable

    Public Sub DWI()
    Dim WIWI As New OleDb.OleDbDataAdapter
    WIWI = New OleDb.OleDbDataAdapter("select * from barang", MUSTIKA)
    cari.Rows.Clear()
    WIWI.Fill(cari)
    WIWI.Dispose()
    End Sub

    Private Sub LATIHAN034B_054_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    DWI()
    DGV_054.DataSource = cari
    End Sub

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

    Private Sub Ww1_054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ww1_054.Click
    If LATIHAN034C_054.Visible = False Then
    LATIHAN034C_054.Show()
    Else
    LATIHAN034C_054.Activate()
    End If
    LATIHAN034C_054.KBL_054.Text = DGV_054.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN034C_054.WW1_054.Text = DGV_054.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN034C_054.WW2_054.Text = DGV_054.CurrentRow.Cells("NAMABARANG").Value
    LATIHAN034C_054.WW3_054.Text = DGV_054.CurrentRow.Cells("HARGAJUAL").Value
    LATIHAN034C_054.WW4_054.Text = DGV_054.CurrentRow.Cells("JUMLAHBARANG").Value()
    End Sub

    Private Sub Ww3_054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ww3_054.Click
    Dim CHAERUNNISA As New OleDb.OleDbCommand
    CHAERUNNISA = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DGV_054.CurrentRow.Cells("KODEBARANG").Value & "'", MUSTIKA)
    MUSTIKA.Open()
    CHAERUNNISA.ExecuteNonQuery()
    MUSTIKA.Close()
    CHAERUNNISA.Dispose()
    DWI()
    End Sub
    End Class

    BalasHapus
  27. Public Class LATIHAN034C_054

    Dim MUSTIKA As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=WIWI")
    Dim CARI As New ByIskandar.CariKeDataBaseByIskandar

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

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

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

    If Val(WW4_054.Text) = 0 Then
    MsgBox("JUMLAH BELUM TERISI")
    Exit Sub
    End If

    CARI.AturPencarianDataBase("barang", "kode barang", WW1_054.Text, 1, MUSTIKA)

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


    Dim CHAERUNNISA As New OleDb.OleDbCommand
    CHAERUNNISA = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & WW1_054.Text & "','" & WW2_054.Text & "'," & Val(WW3_054.Text) & "," & Val(WW4_054.Text) & ")", MUSTIKA)

    MUSTIKA.Open()
    CHAERUNNISA.ExecuteNonQuery()
    MUSTIKA.Close()
    CHAERUNNISA.Dispose()

    WW1_054.Text = ""
    WW2_054.Text = ""
    WW3_054.Text = ""
    WW4_054.Text = ""

    LATIHAN034B_054.DWI()
    End Sub

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

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

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

    If Val(WW4_054.Text) = 0 Then
    MsgBox("JUMLAH BELUM TERISI")
    Exit Sub
    End If

    If KBL_054.Text <> WW1_054.Text Then
    CARI.AturPencarianDataBase("barang", "kode barang", WW1_054.Text, 1, MUSTIKA)

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


    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("update barang set kodebarang ='" & WW1_054.Text & "',namabarang='" & WW2_054.Text & "',hargajual=" & Val(WW3_054.Text) & ", jumlahbarang=" & Val(WW4_054.Text) & "where kodebarang='" & KBL_054.Text & "'", MUSTIKA)

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

    WW1_054.Text = ""
    WW2_054.Text = ""
    WW3_054.Text = ""
    WW4_054.Text = ""
    KBL_054.Text = "-"


    LATIHAN034B_054.DWI()
    End Sub

    Private Sub Dwi1_054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dwi1_054.Click
    If KBL_054.Text = "-" Then
    TAMBAH()
    Else
    EDIT()
    End If
    End Sub
    End Class

    BalasHapus
  28. http://ildayani.blogspot.com/2012/10/latihan34a46110002.html

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

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

    BalasHapus
  29. http://wahyunirachman.blogspot.com/2012/10/latihan34a46110020.html

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

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

    BalasHapus
  30. http://srikartikafanty.blogspot.com/2012/10/latihan34a46110007.html
    http://srikartikafanty.blogspot.com/2012/10/latihan34b46110007.html
    http://srikartikafanty.blogspot.com/2012/10/latihan34c46110007.html

    BalasHapus
  31. http://alfaega.blogspot.com/2012/10/latihan34a46110022_12.html

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

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

    BalasHapus
  32. http://hanihasan07.blogspot.com/2012/10/latihan34a46110044.html
    http://hanihasan07.blogspot.com/2012/10/latihan34b46110044.html
    http://hanihasan07.blogspot.com/2012/10/latihan34c46110044.html

    BalasHapus
  33. http://idhamsyaam.blogspot.com/2012/10/latihan3446110021.html

    BalasHapus
  34. http://sulhihusni.blogspot.com/2012/10/latihan34a46110004.html
    http://sulhihusni.blogspot.com/2012/10/latihan34b46110004.html
    http://sulhihusni.blogspot.com/2012/10/latihan34c46110004.html

    BalasHapus
  35. http://restyaccounting.blogspot.com/2012/10/latihan34a46110027.html
    http://restyaccounting.blogspot.com/2012/10/latihan34b46110027.html
    http://restyaccounting.blogspot.com/2012/10/latihan34c46110027.html

    BalasHapus
  36. http://amalmaulana92.blogspot.com/2012/10/latihan34a46110003.html
    http://amalmaulana92.blogspot.com/2012/10/latihan34b46110003.html
    http://amalmaulana92.blogspot.com/2012/10/latihan34c46110003.html

    BalasHapus
  37. http://diyanahdina.blogspot.com/2012/10/latihan34a46110045.html

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

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

    BalasHapus
  38. http://mulyawarman039.blogspot.com/2012/10/latihan34a46110039.html
    http://mulyawarman039.blogspot.com/2012/10/latihan34b46110039.html
    http://mulyawarman039.blogspot.com/2012/10/latihan34c46110039.html

    BalasHapus
  39. http://dianmegariski.blogspot.com/2012/10/latihan34a46110023.html

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

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

    BalasHapus
  40. http://fitrianihamka.blogspot.com/2012/10/latihan34a46110006.html
    http://fitrianihamka.blogspot.com/2012/10/latihan34b46110006.html
    http://fitrianihamka.blogspot.com/2012/10/latihan34c46110006.html

    BalasHapus
  41. http://muthmil8.blogspot.com/2012/10/latihan34a34bdan34c46110037.html

    BalasHapus
  42. http://feibyfrycilia.blogspot.com/2012/10/latihan34a46110055.html
    http://feibyfrycilia.blogspot.com/2012/10/latihan34b46110055.html
    http://feibyfrycilia.blogspot.com/2012/10/latihan34c46110055.html

    BalasHapus
  43. http://bahrizj.blogspot.com/2012/10/latihan3446110001.html

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

    BalasHapus
  45. http://rafidashaleh.blogspot.com/2012/10/latihan34a46110041.html
    http://rafidashaleh.blogspot.com/2012/10/latihan34b46110041.html
    http://rafidashaleh.blogspot.com/2012/10/latihan34c46110041.html

    BalasHapus
  46. http://cacalisa.blogspot.com/2012/10/latihan34a46110038.html
    http://cacalisa.blogspot.com/2012/10/latihan34b46110038.html
    http://cacalisa.blogspot.com/2012/10/latihan34c46110038_14.html

    BalasHapus
  47. http://bothbon.blogspot.com/2012/10/latihan34a46110043.html
    http://bothbon.blogspot.com/2012/10/latihan34b46110043.html
    http://bothbon.blogspot.com/2012/10/latihan34c46110043.html

    BalasHapus
  48. http://yuliaasrida427.blogspot.com/2012/10/latihan34a46110009.html
    http://yuliaasrida427.blogspot.com/2012/10/latihan34b46110009.html
    http://yuliaasrida427.blogspot.com/2012/10/latihan34c46110009.html

    BalasHapus
  49. http://masdarwati.blogspot.com/2012/10/latihan34a46110024.html
    http://masdarwati.blogspot.com/2012/10/latihan34b46110024.html
    http://masdarwati.blogspot.com/2012/10/latihan34c46110024.html

    BalasHapus
  50. http://deodns.blogspot.com/#!/2013/01/latihan34a46110040.html
    http://deodns.blogspot.com/#!/2013/01/latihan33b46110040_30.html
    http://deodns.blogspot.com/#!/2013/01/latihan34a46110040_30.html

    BalasHapus