Public Class Latihan28a_035 Dim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb") Dim take As New DataTable Public Sub ambildata() 'mendeklarasikan adapter Dim data As New OleDb.OleDbDataAdapter
'mengatur data yang akan diangkut data = New OleDb.OleDbDataAdapter("SELECT* from BARANG", go)
'bersihkan data sebelum mengisi data lain take.Rows.Clear()
'memasukkan data yg telah diambil ke dalam data grid view data.Fill(take) data.Dispose() End Sub
Private Sub Latihan28a_035_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() View.Details = take End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'menampilkan form latihan28b If Latihan28b_035.Visible = False Then Latihan28b_035.Show() Else Latihan28b_035.Activate() End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub End Class
REVISI LATIHAN 27-34 Public Class LATIHAN02736109047
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=4433221100") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap If Val(t136109047.Text) = 0 Then 'untuk pencarian yg bersifat angka MsgBox("kode barang belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If t236109047.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109047.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109047.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
'untuk mencari jgn sampai data yg akan dimasukkan sudah ada cari.AturPencarianDataBase("BARANG", "KODEBARANG", t136109047.Text, 1, conect)
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109047.Text & "','" & t236109047.Text & "'," & Val(t336109047.Text) & "," & Val(t436109047.Text) & ")", conect)
Public Class LATIHAN034A36109047 Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If LATIHAN034B36109047.Visible = False Then LATIHAN034B36109047.MdiParent = Me.MdiParent LATIHAN034B36109047.Show()
Else LATIHAN034B36109047.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 LATIHAN034C36109047.Visible = False Then LATIHAN034C36109047.MdiParent = Me.MdiParent LATIHAN034C36109047.Show()
Else LATIHAN034C36109047.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 ToolStripButton136109047.Click If LATIHAN034B36109047.Visible = False Then LATIHAN034B36109047.MdiParent = Me.MdiParent LATIHAN034B36109047.Show()
Else LATIHAN034B36109047.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 ToolStripButton236109047.Click If LATIHAN034C36109047.Visible = False Then LATIHAN034C36109047.MdiParent = Me.MdiParent LATIHAN034C36109047.Show()
Else LATIHAN034C36109047.Activate() 'jika sdh muncul tp dibelakang End If End Sub
Public Class LATIHAN034C36109047 '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") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub TAMBAH() 'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap If t136109047.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If t236109047.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109047.Text) = 0 Then 'untuk pencarian yg bersifat angka MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109047.Text) = 0 Then MsgBox("JUMLAH BELUM TERISI") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t136109047.Text & "','" & t236109047.Text & "'," & Val(t336109047.Text) & "," & Val(t436109047.Text) & ")", conect)
Private Sub EDIT() 'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap If t136109047.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If t236109047.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109047.Text) = 0 Then 'untuk pencarian yg bersifat angka MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109047.Text) = 0 Then MsgBox("JUMLAH BELUM TERISI") Exit Sub End If
If KB.Text <> t136109047.Text Then 'jika kode barang yg akan diganti dengan kode penggantinya tidak sama cari.AturPencarianDataBase("barang", "kode barang", t136109047.Text, 1, conect)
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("update barang set kodebarang ='" & t136109047.Text & "',namabarang='" & t236109047.Text & "',hargajual=" & Val(t336109047.Text) & ", jumlahbarang=" & Val(t436109047.Text) & "where kodebarang='" & KB.Text & "'", conect)
Private Sub Button136109047_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109047.Click If KB.Text = "-" Then TAMBAH() Else EDIT() End If End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If LATIHAN034B36109038.Visible = False Then LATIHAN034B36109038.MdiParent = Me.MdiParent LATIHAN034B36109038.Show()
Else LATIHAN034B36109038.Activate() End If End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click If LATIHAN034C36109038.Visible = False Then LATIHAN034C36109038.MdiParent = Me.MdiParent LATIHAN034C36109038.Show()
Else LATIHAN034C36109038.Activate() End If End Sub
Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click If LATIHAN034B36109038.Visible = False Then LATIHAN034B36109038.MdiParent = Me.MdiParent LATIHAN034B36109038.Show()
Else LATIHAN034B36109038.Activate() End If End Sub
Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click If LATIHAN034C36109038.Visible = False Then LATIHAN034C36109038.MdiParent = Me.MdiParent LATIHAN034C36109038.Show()
Else LATIHAN034C36109038.Activate() End If End Sub End Class
Public Class LATIHAN034B36109038 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=icha") Dim dtab As New DataTable
Public Sub Icha() 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 LATIHAN034B36109038_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Icha() DataGridView136109038.DataSource = dtab End Sub
Private Sub Button236109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button236109038.Click If LATIHAN034C36109038.Visible = False Then LATIHAN034C36109038.Show() Else LATIHAN034C36109038.Activate() End If End Sub
Private Sub Button136109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button136109038.Click If LATIHAN034C36109038.Visible = False Then LATIHAN034C36109038.Show() Else LATIHAN034C36109038.Activate() End If LATIHAN034C36109038.KB36109038.Text = DataGridView136109038.CurrentRow.Cells("KODEBARANG").Value LATIHAN034C36109038.t136109038.Text = DataGridView136109038.CurrentRow.Cells("KODEBARANG").Value LATIHAN034C36109038.t236109038.Text = DataGridView136109038.CurrentRow.Cells("NAMABARANG").Value LATIHAN034C36109038.t336109038.Text = DataGridView136109038.CurrentRow.Cells("HARGAJUAL").Value LATIHAN034C36109038.t436109038.Text = DataGridView136109038.CurrentRow.Cells("JUMLAHBARANG").Value() End Sub End Class
Public Class LATIHAN034C36109038 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=icha") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub TAMBAH() If t136109038.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109038.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109038.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109038.Text) = 0 Then MsgBox("JUMLAH BELUM TERISI") Exit Sub End If
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('" & t136109038.Text & "','" & t236109038.Text & "'," & Val(t336109038.Text) & "," & Val(t436109038.Text) & ")", conect)
Private Sub EDIT() If t136109038.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109038.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109038.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109038.Text) = 0 Then MsgBox("JUMLAH BELUM TERISI") Exit Sub End If
If KB36109038.Text <> t136109038.Text Then cari.AturPencarianDataBase("barang", "kode barang", t136109038.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 ='" & t136109038.Text & "',namabarang='" & t236109038.Text & "',hargajual=" & Val(t336109038.Text) & ", jumlahbarang=" & Val(t436109038.Text) & "where kodebarang='" & KB36109038.Text & "'", conect)
Private Sub Button136109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button136109038.Click If KB36109038.Text = "-" Then TAMBAH() Else EDIT() End If End Sub End Class
Private Sub Latihan34B36109046_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load zaza() DataGridView1.DataSource = dtab End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If Latihan34C36109046.Visible = False Then Latihan34C36109046.Show() Else Latihan34C36109046.Activate() End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Latihan34C36109050.Visible = False Then Latihan34C36109050.Show() Else Latihan34C36109050.Activate() 'jika sdh muncul tp dibelakang End If Latihan34C36109050.KB.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value Latihan34C36109050.t1.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value Latihan34C36109050.t2.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value Latihan34C36109050.t3.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value Latihan34C36109050.t4.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 ZAHRAH As New OleDb.OleDbCommand ZAHRAH = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DataGridView1.CurrentRow.Cells("KODEBARANG").Value & "'", conect) conect.Open() ZAHRAH.ExecuteNonQuery() conect.Close() ZAHRAH.Dispose() zaza() End Sub End Class
Public Class Latihan34C36109046 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=14322836") Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub TAMBAH() If t136109046.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If If t236109046.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If If Val(t336109046.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If If Val(t436109046.Text) = 0 Then MsgBox("JUMLAH BELUM TERISI") Exit Sub End If cari.AturPencarianDataBase("barang", "kode barang", t136109046.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('" & t136109046.Text & "','" & t236109046.Text & "'," & Val(t336109046.Text) & "," & Val(t436109046.Text) & ")", conect) conect.Open() com.ExecuteNonQuery() conect.Close() com.Dispose() t136109046.Text = "" t236109046.Text = "" t336109046.Text = "" t436109046.Text = "" Latihan33A36109046.zaza() End Sub Private Sub EDIT() If t136109046.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If If t236109046.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If If Val(t336109046.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If If Val(t436109046.Text) = 0 Then MsgBox("JUMLAH BELUM TERISI") Exit Sub End If If KB36109046.Text <> t136109046.Text Then cari.AturPencarianDataBase("barang", "kode barang", t136109046.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 ='" & t136109046.Text & "',namabarang='" & t236109046.Text & "',hargajual=" & Val(t336109046.Text) & ", jumlahbarang=" & Val(t436109046.Text) & "where kodebarang='" & KB36109046.Text & "'", conect) conect.Open() com.ExecuteNonQuery() conect.Close() com.Dispose() t136109046.Text = "" t236109046.Text = "" t336109046.Text = "" t436109046.Text = "" KB36109046.Text = "-" Latihan32A36109046.zaza() End Sub Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click() If KB36109046.Text = "-" Then TAMBAH() Else EDIT() End If End Sub End class
Public Class LATIHAN034A012 Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click If LATIHAN034B012.Visible = False Then LATIHAN034B012.MdiParent = Me LATIHAN034B012.Show() Else LATIHAN034B012.Activate() End If End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click If LATIHAN034C012.Visible = False Then LATIHAN034C012.MdiParent = Me LATIHAN034C012.Show() Else LATIHAN034C012.Activate() End If End Sub End Class
Public Class LATIHAN034D36109043 Dim cari As New ByIskandar.CariKeDataBaseByIskandar Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=280765") Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, konek) kha() Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", konek) konek.Open() com.ExecuteNonQuery() konek.Close() com.Dispose()
End If Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", konek)
t1.Text = "" t2.Text = "" t3.Text = "" t4.Text = "" End If End Sub Public Sub kha() If cari.JumlanBaris > 0 Then MsgBox("kode barang telah ada") t1.Text = "" Exit Sub ElseIf t1.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf t2.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf t3.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf t3.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If End Sub End Class
Public Class Latih34A_36109034 Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click If Latih34B_36109034.Visible = False Then Latih34B_36109034.MdiParent = Me Latih34B_36109034.Show() Else Latih34B_36109034.Activate() End If End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click If Latih34C_36109034.Visible = False Then Latih34C_36109034.MdiParent = Me Latih34C_36109034.Show() Else Latih34C_36109034.Activate() End If End Sub
Public Class Latih34B_36109034 Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=nhunoe") Dim nhunoe As New DataTable Dim cobaji As New OleDb.OleDbDataAdapter Dim angkut As New OleDb.OleDbCommand Private Sub Latih34B_36109034_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect) cobaji.Fill(nhunoel) DataGridView1.DataSource = nhunoe End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Latih34D_36109034.Visible = False Then Latih34D_36109034.Show() Else Latih34D_36109034.Activate() End If Latih34D_36109034.ToolStripStatusLabel1.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value Latih34D_36109034.t1.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value Latih34D_36109034.t2.Text = DataGridView1.CurrentRow.Cells("NamaBarang").Value Latih34D_36109034.t3.Text = DataGridView1.CurrentRow.Cells("Hargajual").Value Latih34D_36109034.t4.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 yaya As String = "delete * from barang where kodebarang = '" & DataGridView1.CurrentRow.Cells("kodebarang").Value & "'" angkut = New OleDb.OleDbCommand(yaya, conect) conect.Open() angkut.ExecuteNonQuery() conect.Close() angkut.Dispose() cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect) cobaji.Fill(nhunoe) DataGridView1.DataSource = nhunoe End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If Latih34D_36109034.Visible = False Then Latih34D_36109034.Show() Else Latih34D_36109034.Activate() End If End Sub End Class
ublic Class Latih34C_36109034 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=nhunoe") Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
Public Class Latih34D_36109034 Dim cari As New ByIskandar.CariKeDataBaseByIskandar Dim conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=nhunoe") Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, conect) noe() Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect) conect.Open() com.ExecuteNonQuery() conect.Close() com.Dispose()
End If Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)
t1.Text = "" t2.Text = "" t3.Text = "" t4.Text = "" End If End Sub Public Sub noe() If cari.JumlanBaris > 0 Then MsgBox("kode barang telah ada") t1.Text = "" Exit Sub ElseIf t1.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf t2.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf t3.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf t3.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If End Sub End Class
Private Sub ToolStripButton136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton136109032.Click, DAFTARBARANGToolStripMenuItem.Click If LATIHAN034B36109032.Visible = False Then LATIHAN034B36109032.MdiParent = Me LATIHAN034B36109032.Show() Else LATIHAN034B36109032.Activate() End If End Sub
Private Sub ToolStripButton236109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton236109032.Click, INPUTBARANGToolStripMenuItem.Click If LATIHAN034C36109032.Visible = False Then LATIHAN034C36109032.MdiParent = Me LATIHAN034C36109032.Show() Else LATIHAN034C36109032.Activate() End If
Dim sambung As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=jayapura") Dim pusat As New DataTable Dim lanjutkan As New OleDb.OleDbDataAdapter Dim nonton As New OleDb.OleDbCommand
Private Sub LATIHAN034B36109032_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load lanjutkan = New OleDb.OleDbDataAdapter("select * from barang", sambung) lanjutkan.Fill(pusat) DataGridView136109032.DataSource = pusat End Sub
Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click If LATIHAN034D36109043.Visible = False Then LATIHAN034D36109043.Show() Else LATIHAN034D36109043.Activate() End If LATIHAN034D36109043.ToolStripStatusLabel1.Text = DataGridView136109032.CurrentRow.Cells("KodeBarang").Value LATIHAN034D36109043.t1.Text = DataGridView136109032.CurrentRow.Cells("KodeBarang").Value LATIHAN034D36109043.t2.Text = DataGridView136109032.CurrentRow.Cells("NamaBarang").Value LATIHAN034D36109043.t3.Text = DataGridView136109032.CurrentRow.Cells("Hargajual").Value LATIHAN034D36109043.t4.Text = DataGridView136109032.CurrentRow.Cells("jumlahbarang").Value End Sub
Private Sub Button336109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button336109032Click Dim laptop As String = "delete * from barang where kodebarang = '" & DataGridView136109032.CurrentRow.Cells("kodebarang").Value & "'" nonton = New OleDb.OleDbCommand(laptop, sambung) sambung.Open() nonton.ExecuteNonQuery() sambung.Close() nonton.Dispose() lanjutkan = New OleDb.OleDbDataAdapter("select * from barang", sambung) lanjutkan.Fill(pusat) DataGridView136109032.DataSource = pusat End Sub
Private Sub Button236109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109032.Click If LATIHAN034D36109043.Visible = False Then LATIHAN034D36109043.Show() Else LATIHAN034D36109043.Activate() End If
Dim sambung As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=jayapura") Dim misal As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click
If misal.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & T136109032.Text & "','" & T236109032.Text & "'," & Val(T336109032.Text) & "," & Val(T436109032.Text) & ")", sambung)
Public Class LATIHAN034A36109045 Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If LATIHAN034B36109047.Visible = False Then LATIHAN034B36109047.MdiParent = Me.MdiParent LATIHAN034B36109047.Show()
Else LATIHAN034B36109045.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 LATIHAN034C36109045.Visible = False Then LATIHAN034C36109045.MdiParent = Me.MdiParent LATIHAN034C36109045.Show()
Else LATIHAN034C36109045.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 ToolStripButton136109045.Click If LATIHAN034B36109045.Visible = False Then LATIHAN034B36109045.MdiParent = Me.MdiParent LATIHAN034B36109045.Show()
Else LATIHAN034B36109045.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 ToolStripButton236109045.Click If LATIHAN034C36109045.Visible = False Then LATIHAN034C36109045.MdiParent = Me.MdiParent LATIHAN034C36109045.Show()
Else LATIHAN034C36109045.Activate() 'jika sdh muncul tp dibelakang End If End Sub
Private Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click If LATIHAN34B36109044.Visible = False Then LATIHAN34B36109044.MdiParent = Me.MdiParent LATIHAN34B36109044.Show()
Else LATIHAN34B36109044.Activate() End If End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click If LATIHAN34C36109044.Visible = False Then LATIHAN34C36109044.MdiParent = Me.MdiParent LATIHAN34C36109044.Show()
Else LATIHAN34C36109044.Activate() End If End Sub
Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click If LATIHAN34B36109044.Visible = False Then LATIHAN34B36109044.MdiParent = Me.MdiParent LATIHAN34B36109044.Show()
Else LATIHAN34B36109044.Activate() End If End Sub
Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click If LATIHAN34C36109044.Visible = False Then LATIHAN34C36109044.MdiParent = Me.MdiParent LATIHAN34C36109044.Show()
Public Class LATIHAN34B36109044 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah") Dim firah As New DataTable
Public Sub magfirah() Dim mula As New OleDb.OleDbDataAdapter mula = New OleDb.OleDbDataAdapter("select * from barang", conect) firah.Rows.Clear() mula.Fill(firah) mula.Dispose()
End Sub
Private Sub LATIHAN34B36109044_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load magfirah() DataGridView1.DataSource = firah End Sub
Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click If LATIHAN34C36109044.Visible = False Then LATIHAN34C36109044.Show() Else LATIHAN34C36109044.Activate() End If End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click If LATIHAN34C36109044.Visible = False Then LATIHAN34C36109044.Show() Else LATIHAN34C36109044.Activate() End If LATIHAN34C36109044.KB.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value LATIHAN34C36109044.t136109044.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value LATIHAN34C36109044.t236109044.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value LATIHAN34C36109044.t336109044.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value LATIHAN34C36109044.t436109044.Text = DataGridView1.CurrentRow.Cells("JUMLAHBARANG").Value() End Sub
Public Class LATIHAN34C36109044 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah") Dim firah As New ByIskandar.CariKeDataBaseByIskandar
Private Sub TAMBAH() If t136109044.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109044.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109044.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109044.Text) = 0 Then MsgBox("JUMLAH BELUM TERISI") Exit Sub End If
If firah.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('" & t136109044.Text & "','" & t236109044.Text & "'," & Val(t336109044.Text) & "," & Val(t436109044.Text) & ")", conect)
Private Sub EDIT() If t136109044.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109044.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109044.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109044.Text) = 0 Then MsgBox("JUMLAH BELUM TERISI") Exit Sub End If
If KB.Text <> t136109044.Text Then firah.AturPencarianDataBase("barang", "kode barang", t136109044.Text, 1, conect)
If firah.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 ='" & t136109044.Text & "',namabarang='" & t236109044.Text & "',hargajual=" & Val(t336109044.Text) & ", jumlahbarang=" & Val(t436109044.Text) & "where kodebarang='" & KB.Text & "'", conect)
Private Sub Button136109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click If KB.Text = "-" Then TAMBAH() Else EDIT() End If End Sub
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=2422") Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1_36109056.Text & "','" & t2_36109056.Text & "'," & Val(t3_36109056.Text) & "," & Val(t4_36109056.Text) & ")", conect)
Public Class LATIHAN_034D_36109056 Dim cari As New ByIskandar.CariKeDataBaseByIskandar Dim conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=2422") Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then cari.AturPencarianDataBase("Barang", "KodeBarang", t1_36109056.Text, 1, konek) bie() Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1_36109056.Text & "','" & t2_36109056.Text & "'," & Val(t3_36109056.Text) & "," & Val(t4_36109056.Text) & ")", conect) conect.Open() com.ExecuteNonQuery() conect.Close() com.Dispose()
End If Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1_36109056.Text & "', namabarang = '" & t2_36109056.Text & "', hargajual = " & Val(t3_36109056.Text) & ", jumlahbarang = " & Val(t4_36109056.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)
t1_36109056.Text = "" t2_36109056.Text = "" t3_36109056.Text = "" t4_36109056.Text = "" End If End Sub Public Sub bie() If cari.JumlanBaris > 0 Then MsgBox("kode barang telah ada") t1_36109056.Text = "" Exit Sub ElseIf t1_36109056.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf t2_36109056.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf t3_36109056.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf t3_36109056.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If End Sub End Class
Dim cari As New ByIskandar.CariKeDataBaseByIskandar Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=jayapura")
Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click If ToolStripStatusLabel136109032.Text = "KODE BARANG LAMA" Then misal.AturPencarianDataBase("Barang", "KodeBarang", T136109032.Text, 1, sambung) speaker() Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & T136109032.Text & "','" & T236109032.Text & "'," & Val(T336109032.Text) & "," & Val(T436109032.Text) & ")", sambung) sambung.Open() com.ExecuteNonQuery() sambung.Close() com.Dispose()
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & T136109032.Text & "', namabarang = '" & T236109032.Text & "', hargajual = " & Val(T336109032.Text) & ", jumlahbarang = " & Val(T 4361090324.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", sambung) sambung.Open() com.ExecuteNonQuery() sambung.Close() com.Dispose()
T136109032.Text = "" T236109032.Text = "" T336109032.Text = "" T436109032.Text = "" End If End Sub
Public Sub speaker() If misal.JumlanBaris > 0 Then MsgBox("kode barang telah ada") T136109032.Text = "" Exit Sub ElseIf T136109032.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf T236109032.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf T336109032.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf T336109032.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If
Public Class Form34C36109050 '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") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub TAMBAH() 'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap If t1.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If t2.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t3.Text) = 0 Then 'untuk pencarian yg bersifat angka MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t4.Text) = 0 Then MsgBox("JUMLAH BELUM TERISI") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect) conect.Open() 'jembatannya dibuka com.ExecuteNonQuery() 'jalankan perintahnya conect.Close() 'tutup jembatan com.Dispose() 'hancurkan comand
Private Sub EDIT() 'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap If t1.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub 'jgn lanjut ke proses berikutnya End If
If t2.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t3.Text) = 0 Then 'untuk pencarian yg bersifat angka MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t4.Text) = 0 Then MsgBox("JUMLAH BELUM TERISI") Exit Sub End If
If KB.Text <> t1.Text Then 'jika kode barang yg akan diganti dengan kode penggantinya tidak sama cari.AturPencarianDataBase("barang", "kode barang", t1.Text, 1, conect)
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("update barang set kodebarang ='" & t1.Text & "',namabarang='" & t2.Text & "',hargajual=" & Val(t3.Text) & ", jumlahbarang=" & Val(t4.Text) & "where kodebarang='" & KB.Text & "'", conect)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If KB.Text = "-" Then TAMBAH() Else EDIT() End If End Sub End Class
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=praditya") Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
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 ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
Public Class Lat34A36109042 Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click If Lat34B36109042.Visible = False Then Lat34B36109042.MdiParent = Me Lat34B36109042.Show() Else Lat34B36109042.Activate() End If End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click If Lat34C36109042.Visible = False Then Lat34C36109042.MdiParent = Me Lat34C36109042.Show() Else Lat34C36109042.Activate() End If End Sub
Public Class Lat34C36109042 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=25") Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109042.Click
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109042.Text & "','" & t236109042.Text & "'," & Val(t336109042.Text) & "," & Val(t436109042.Text) & ")", conect)
Public Class LATIHAN034A36109040 Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click If LATIHAN034B036109040.Visible = False Then LATIHAN034B36109040.MdiParent = Me LATIHAN034B036109040.Show() Else LATIHAN034B36109040.Activate() End If End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click If LATIHAN034C36109040.Visible = False Then LATIHAN034C36109040.MdiParent = Me LATIHAN034C36109040.Show() Else LATIHAN034C36109040.Activate() End If End Sub End Class
Public Class LATIHAN034C36109040 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=150991") Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
Public Class LATIHAN034D36109040 Dim cari As New ByIskandar.CariKeDataBaseByIskandar Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=150991") Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, konek) gue() Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", konek) konek.Open() com.ExecuteNonQuery() konek.Close() com.Dispose()
End If Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", konek)
t1.Text = "" t2.Text = "" t3.Text = "" t4.Text = "" End If End Sub Public Sub kha() If cari.JumlanBaris > 0 Then MsgBox("kode barang telah ada") t1.Text = "" Exit Sub ElseIf t1.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf t2.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf t3.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf t3.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If End Sub End Class
Public Class LATIHAN034A36109030 Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click If LATIHAN034B36109030.Visible = False Then LATIHAN034B36109030.MdiParent = Me LATIHAN034B36109030.Show() Else LATIHAN034B36109030.Activate() End If End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click If LATIHAN034C36109030.Visible = False Then LATIHAN034C36109030.MdiParent = Me LATIHAN034C36109030.Show() Else LATIHAN034C36109030.Activate() End If End Sub
Public Class LATIHAN034C36109030 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=sanie") Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
'untuk memasukkan data dari visual basic ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
Public Class LATIHAN034D_36109037 Dim cari As New ByIskandar.CariKeDataBaseByIskandar Dim Conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=2901911691") Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then cari.AturPencarianDataBase("Barang", "KodeBarang", t136109037.Text, 1, Conect) kha() Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109037.Text & "','" & t236109037.Text & "'," & Val(t336109037.Text) & "," & Val(t436109037.Text) & ")", Conect) Conect.Open() com.ExecuteNonQuery() Conect.Close() com.Dispose()
End If Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t136109037.Text & "', namabarang = '" & t236109037.Text & "', hargajual = " & Val(t336109037.Text) & ", jumlahbarang = " & Val(t436109037.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", Conect)
t136109037.Text = "" t236109037.Text = "" t336109037.Text = "" t436109037.Text = "" End If End Sub Public Sub kha() If cari.JumlanBaris > 0 Then MsgBox("kode barang telah ada") t136109037.Text = "" Exit Sub ElseIf t136109037.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf t236109037.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf t336109037.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf t336109037.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If End Sub End Class
Public Class LATIHAN034A36109045 Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click If Latihan_034B_36109045.Visible = False Then Latihan_034B_36109045.MdiParent = Me Latihan_034B_36109045.Show() Else Latihan_034B_36109045.Activate() End If End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click If Latihan_034C_36109045.Visible = False Then Latihan_034C_36109045.MdiParent = Me Latihan_034C_36109045.Show() Else Latihan_034C_36109045.Activate() End If End Sub End Class
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=florista") Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
'untuk memasukkan data dari visual basc ke dlm acces Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
Dim cari As New ByIskandar.CariKeDataBaseByIskandar Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=florista") Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, konek) kha() Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", konek) konek.Open() com.ExecuteNonQuery() konek.Close() com.Dispose()
End If Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", konek)
t1.Text = "" t2.Text = "" t3.Text = "" t4.Text = "" End If End Sub Public Sub kha() If cari.JumlanBaris > 0 Then MsgBox("kode barang telah ada") t1.Text = "" Exit Sub ElseIf t1.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf t2.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf t3.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf t3.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If End Sub End Class
Public Class Latihan28a_035
BalasHapusDim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb")
Dim take As New DataTable
Public Sub ambildata()
'mendeklarasikan adapter
Dim data As New OleDb.OleDbDataAdapter
'mengatur data yang akan diangkut
data = New OleDb.OleDbDataAdapter("SELECT* from BARANG", go)
'bersihkan data sebelum mengisi data lain
take.Rows.Clear()
'memasukkan data yg telah diambil ke dalam data grid view
data.Fill(take)
data.Dispose()
End Sub
Private Sub Latihan28a_035_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
View.Details = take
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'menampilkan form latihan28b
If Latihan28b_035.Visible = False Then
Latihan28b_035.Show()
Else
Latihan28b_035.Activate()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
Komentar ini telah dihapus oleh pengarang.
BalasHapusKomentar ini telah dihapus oleh pengarang.
BalasHapusREVISI LATIHAN 27-34
BalasHapusPublic Class LATIHAN02736109047
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=4433221100")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
If Val(t136109047.Text) = 0 Then 'untuk pencarian yg bersifat angka
MsgBox("kode barang belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If t236109047.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109047.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109047.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
'untuk mencari jgn sampai data yg akan dimasukkan sudah ada
cari.AturPencarianDataBase("BARANG", "KODEBARANG", t136109047.Text, 1, conect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109047.Text & "','" & t236109047.Text & "'," & Val(t336109047.Text) & "," & Val(t436109047.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t136109047.Text = ""
t236109047.Text = ""
t336109047.Text = ""
t436109047.Text = ""
End Sub
End Class
Public Class LATIHAN034A36109047
BalasHapusPrivate Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If LATIHAN034B36109047.Visible = False Then
LATIHAN034B36109047.MdiParent = Me.MdiParent
LATIHAN034B36109047.Show()
Else
LATIHAN034B36109047.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 LATIHAN034C36109047.Visible = False Then
LATIHAN034C36109047.MdiParent = Me.MdiParent
LATIHAN034C36109047.Show()
Else
LATIHAN034C36109047.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 ToolStripButton136109047.Click
If LATIHAN034B36109047.Visible = False Then
LATIHAN034B36109047.MdiParent = Me.MdiParent
LATIHAN034B36109047.Show()
Else
LATIHAN034B36109047.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 ToolStripButton236109047.Click
If LATIHAN034C36109047.Visible = False Then
LATIHAN034C36109047.MdiParent = Me.MdiParent
LATIHAN034C36109047.Show()
Else
LATIHAN034C36109047.Activate() 'jika sdh muncul tp dibelakang
End If
End Sub
End Class
Public Class LATIHAN034C36109047
BalasHapus'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")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub TAMBAH()
'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
If t136109047.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If t236109047.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109047.Text) = 0 Then 'untuk pencarian yg bersifat angka
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109047.Text) = 0 Then
MsgBox("JUMLAH BELUM TERISI")
Exit Sub
End If
cari.AturPencarianDataBase("barang", "kode barang", t136109047.Text, 1, conect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t136109047.Text & "','" & t236109047.Text & "'," & Val(t336109047.Text) & "," & Val(t436109047.Text) & ")", conect)
conect.Open() 'jembatannya dibuka
com.ExecuteNonQuery() 'jalankan perintahnya
conect.Close() 'tutup jembatan
com.Dispose() 'hancurkan comand
t136109047.Text = ""
t236109047.Text = ""
BalasHapust336109047.Text = ""
t436109047.Text = ""
LATIHAN033A36109047.zaza()
End Sub
Private Sub EDIT()
'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
If t136109047.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If t236109047.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109047.Text) = 0 Then 'untuk pencarian yg bersifat angka
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109047.Text) = 0 Then
MsgBox("JUMLAH BELUM TERISI")
Exit Sub
End If
If KB.Text <> t136109047.Text Then 'jika kode barang yg akan diganti dengan kode penggantinya tidak sama
cari.AturPencarianDataBase("barang", "kode barang", t136109047.Text, 1, conect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("update barang set kodebarang ='" & t136109047.Text & "',namabarang='" & t236109047.Text & "',hargajual=" & Val(t336109047.Text) & ", jumlahbarang=" & Val(t436109047.Text) & "where kodebarang='" & KB.Text & "'", conect)
conect.Open() 'jembatannya dibuka
com.ExecuteNonQuery() 'jalankan perintahnya
conect.Close() 'tutup jembatan
com.Dispose() 'hancurkan comand
t136109047.Text = ""
t236109047.Text = ""
t336109047.Text = ""
t436109047.Text = ""
KB.Text = "-"
LATIHAN032A36109047.zaza()
End Sub
Private Sub Button136109047_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109047.Click
If KB.Text = "-" Then
TAMBAH()
Else
EDIT()
End If
End Sub
End Class
Public Class LATIHAN034A36109038
BalasHapusPrivate Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If LATIHAN034B36109038.Visible = False Then
LATIHAN034B36109038.MdiParent = Me.MdiParent
LATIHAN034B36109038.Show()
Else
LATIHAN034B36109038.Activate()
End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
If LATIHAN034C36109038.Visible = False Then
LATIHAN034C36109038.MdiParent = Me.MdiParent
LATIHAN034C36109038.Show()
Else
LATIHAN034C36109038.Activate()
End If
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
If LATIHAN034B36109038.Visible = False Then
LATIHAN034B36109038.MdiParent = Me.MdiParent
LATIHAN034B36109038.Show()
Else
LATIHAN034B36109038.Activate()
End If
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
If LATIHAN034C36109038.Visible = False Then
LATIHAN034C36109038.MdiParent = Me.MdiParent
LATIHAN034C36109038.Show()
Else
LATIHAN034C36109038.Activate()
End If
End Sub
End Class
Public Class LATIHAN034B36109038
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=icha")
Dim dtab As New DataTable
Public Sub Icha()
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 LATIHAN034B36109038_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Icha()
DataGridView136109038.DataSource = dtab
End Sub
Private Sub Button236109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button236109038.Click
If LATIHAN034C36109038.Visible = False Then
LATIHAN034C36109038.Show()
Else
LATIHAN034C36109038.Activate()
End If
End Sub
Private Sub Button136109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button136109038.Click
If LATIHAN034C36109038.Visible = False Then
LATIHAN034C36109038.Show()
Else
LATIHAN034C36109038.Activate()
End If
LATIHAN034C36109038.KB36109038.Text = DataGridView136109038.CurrentRow.Cells("KODEBARANG").Value
LATIHAN034C36109038.t136109038.Text = DataGridView136109038.CurrentRow.Cells("KODEBARANG").Value
LATIHAN034C36109038.t236109038.Text = DataGridView136109038.CurrentRow.Cells("NAMABARANG").Value
LATIHAN034C36109038.t336109038.Text = DataGridView136109038.CurrentRow.Cells("HARGAJUAL").Value
LATIHAN034C36109038.t436109038.Text = DataGridView136109038.CurrentRow.Cells("JUMLAHBARANG").Value()
End Sub
End Class
Public Class LATIHAN034C36109038
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=icha")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub TAMBAH()
If t136109038.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109038.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109038.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109038.Text) = 0 Then
MsgBox("JUMLAH BELUM TERISI")
Exit Sub
End If
cari.AturPencarianDataBase("barang", "kode barang", t136109038.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('" & t136109038.Text & "','" & t236109038.Text & "'," & Val(t336109038.Text) & "," & Val(t436109038.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t136109038.Text = ""
t236109038.Text = ""
t336109038.Text = ""
t436109038.Text = ""
LATIHAN033A36109038.Icha()
End Sub
Private Sub EDIT()
If t136109038.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109038.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109038.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109038.Text) = 0 Then
MsgBox("JUMLAH BELUM TERISI")
Exit Sub
End If
If KB36109038.Text <> t136109038.Text Then
cari.AturPencarianDataBase("barang", "kode barang", t136109038.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 ='" & t136109038.Text & "',namabarang='" & t236109038.Text & "',hargajual=" & Val(t336109038.Text) & ", jumlahbarang=" & Val(t436109038.Text) & "where kodebarang='" & KB36109038.Text & "'", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t136109038.Text = ""
t236109038.Text = ""
t336109038.Text = ""
t436109038.Text = ""
KB36109038.Text = "-"
LATIHAN032A36109038.Icha()
End Sub
Private Sub Button136109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button136109038.Click
If KB36109038.Text = "-" Then
TAMBAH()
Else
EDIT()
End If
End Sub
End Class
Private Sub Latihan34B36109046_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
BalasHapuszaza()
DataGridView1.DataSource = dtab
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Latihan34C36109046.Visible = False Then
Latihan34C36109046.Show()
Else
Latihan34C36109046.Activate()
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Latihan34C36109050.Visible = False Then
Latihan34C36109050.Show()
Else
Latihan34C36109050.Activate() 'jika sdh muncul tp dibelakang
End If
Latihan34C36109050.KB.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
Latihan34C36109050.t1.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
Latihan34C36109050.t2.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value
Latihan34C36109050.t3.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value
Latihan34C36109050.t4.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 ZAHRAH As New OleDb.OleDbCommand
ZAHRAH = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & DataGridView1.CurrentRow.Cells("KODEBARANG").Value & "'", conect)
conect.Open()
ZAHRAH.ExecuteNonQuery()
conect.Close()
ZAHRAH.Dispose()
zaza()
End Sub
End Class
Public Class Latihan34C36109046
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=14322836")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub TAMBAH()
If t136109046.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109046.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109046.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109046.Text) = 0 Then
MsgBox("JUMLAH BELUM TERISI")
Exit Sub
End If
cari.AturPencarianDataBase("barang", "kode barang", t136109046.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('" & t136109046.Text & "','" & t236109046.Text & "'," & Val(t336109046.Text) & "," & Val(t436109046.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t136109046.Text = ""
t236109046.Text = ""
t336109046.Text = ""
t436109046.Text = ""
Latihan33A36109046.zaza()
End Sub
Private Sub EDIT()
If t136109046.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109046.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109046.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109046.Text) = 0 Then
MsgBox("JUMLAH BELUM TERISI")
Exit Sub
End If
If KB36109046.Text <> t136109046.Text Then
cari.AturPencarianDataBase("barang", "kode barang", t136109046.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 ='" & t136109046.Text & "',namabarang='" & t236109046.Text & "',hargajual=" & Val(t336109046.Text) & ", jumlahbarang=" & Val(t436109046.Text) & "where kodebarang='" & KB36109046.Text & "'", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t136109046.Text = ""
t236109046.Text = ""
t336109046.Text = ""
t436109046.Text = ""
KB36109046.Text = "-"
Latihan32A36109046.zaza()
End Sub
Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click()
If KB36109046.Text = "-" Then
TAMBAH()
Else
EDIT()
End If
End Sub
End class
Public Class LATIHAN034A012
BalasHapusPrivate Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click
If LATIHAN034B012.Visible = False Then
LATIHAN034B012.MdiParent = Me
LATIHAN034B012.Show()
Else
LATIHAN034B012.Activate()
End If
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click
If LATIHAN034C012.Visible = False Then
LATIHAN034C012.MdiParent = Me
LATIHAN034C012.Show()
Else
LATIHAN034C012.Activate()
End If
End Sub
End Class
Public Class LATIHAN034D36109043
BalasHapusDim cari As New ByIskandar.CariKeDataBaseByIskandar
Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=280765")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, konek)
kha()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", konek)
konek.Open()
com.ExecuteNonQuery()
konek.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
Else
If ToolStripStatusLabel1.Text <> t1.Text Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, konek)
kha()
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", konek)
konek.Open()
com.ExecuteNonQuery()
konek.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End If
End Sub
Public Sub kha()
If cari.JumlanBaris > 0 Then
MsgBox("kode barang telah ada")
t1.Text = ""
Exit Sub
ElseIf t1.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf t2.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf t3.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf t3.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
End Sub
End Class
Public Class Latih34A_36109034
BalasHapusPrivate Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click
If Latih34B_36109034.Visible = False Then
Latih34B_36109034.MdiParent = Me
Latih34B_36109034.Show()
Else
Latih34B_36109034.Activate()
End If
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click
If Latih34C_36109034.Visible = False Then
Latih34C_36109034.MdiParent = Me
Latih34C_36109034.Show()
Else
Latih34C_36109034.Activate()
End If
End Sub
Public Class Latih34B_36109034
BalasHapusDim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=nhunoe")
Dim nhunoe As New DataTable
Dim cobaji As New OleDb.OleDbDataAdapter
Dim angkut As New OleDb.OleDbCommand
Private Sub Latih34B_36109034_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect)
cobaji.Fill(nhunoel)
DataGridView1.DataSource = nhunoe
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Latih34D_36109034.Visible = False Then
Latih34D_36109034.Show()
Else
Latih34D_36109034.Activate()
End If
Latih34D_36109034.ToolStripStatusLabel1.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
Latih34D_36109034.t1.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
Latih34D_36109034.t2.Text = DataGridView1.CurrentRow.Cells("NamaBarang").Value
Latih34D_36109034.t3.Text = DataGridView1.CurrentRow.Cells("Hargajual").Value
Latih34D_36109034.t4.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 yaya As String = "delete * from barang where kodebarang = '" & DataGridView1.CurrentRow.Cells("kodebarang").Value & "'"
angkut = New OleDb.OleDbCommand(yaya, conect)
conect.Open()
angkut.ExecuteNonQuery()
conect.Close()
angkut.Dispose()
cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect)
cobaji.Fill(nhunoe)
DataGridView1.DataSource = nhunoe
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Latih34D_36109034.Visible = False Then
Latih34D_36109034.Show()
Else
Latih34D_36109034.Activate()
End If
End Sub
End Class
ublic Class Latih34C_36109034
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=nhunoe")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End Sub
End Class
Public Class Latih34D_36109034
BalasHapusDim cari As New ByIskandar.CariKeDataBaseByIskandar
Dim conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=nhunoe")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, conect)
noe()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
Else
If ToolStripStatusLabel1.Text <> t1.Text Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, conect)
noe()
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End If
End Sub
Public Sub noe()
If cari.JumlanBaris > 0 Then
MsgBox("kode barang telah ada")
t1.Text = ""
Exit Sub
ElseIf t1.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf t2.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf t3.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf t3.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
End Sub
End Class
Public Class LATIHAN034A36109032
BalasHapusPrivate Sub ToolStripButton136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton136109032.Click, DAFTARBARANGToolStripMenuItem.Click
If LATIHAN034B36109032.Visible = False Then
LATIHAN034B36109032.MdiParent = Me
LATIHAN034B36109032.Show()
Else
LATIHAN034B36109032.Activate()
End If
End Sub
Private Sub ToolStripButton236109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton236109032.Click, INPUTBARANGToolStripMenuItem.Click
If LATIHAN034C36109032.Visible = False Then
LATIHAN034C36109032.MdiParent = Me
LATIHAN034C36109032.Show()
Else
LATIHAN034C36109032.Activate()
End If
End Sub
End Class
Public Class LATIHAN034B36109032
BalasHapusDim sambung As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=jayapura")
Dim pusat As New DataTable
Dim lanjutkan As New OleDb.OleDbDataAdapter
Dim nonton As New OleDb.OleDbCommand
Private Sub LATIHAN034B36109032_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lanjutkan = New OleDb.OleDbDataAdapter("select * from barang", sambung)
lanjutkan.Fill(pusat)
DataGridView136109032.DataSource = pusat
End Sub
Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click
If LATIHAN034D36109043.Visible = False Then
LATIHAN034D36109043.Show()
Else
LATIHAN034D36109043.Activate()
End If
LATIHAN034D36109043.ToolStripStatusLabel1.Text = DataGridView136109032.CurrentRow.Cells("KodeBarang").Value
LATIHAN034D36109043.t1.Text = DataGridView136109032.CurrentRow.Cells("KodeBarang").Value
LATIHAN034D36109043.t2.Text = DataGridView136109032.CurrentRow.Cells("NamaBarang").Value
LATIHAN034D36109043.t3.Text = DataGridView136109032.CurrentRow.Cells("Hargajual").Value
LATIHAN034D36109043.t4.Text = DataGridView136109032.CurrentRow.Cells("jumlahbarang").Value
End Sub
Private Sub Button336109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button336109032Click
Dim laptop As String = "delete * from barang where kodebarang = '" & DataGridView136109032.CurrentRow.Cells("kodebarang").Value & "'"
nonton = New OleDb.OleDbCommand(laptop, sambung)
sambung.Open()
nonton.ExecuteNonQuery()
sambung.Close()
nonton.Dispose()
lanjutkan = New OleDb.OleDbDataAdapter("select * from barang", sambung)
lanjutkan.Fill(pusat)
DataGridView136109032.DataSource = pusat
End Sub
Private Sub Button236109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109032.Click
If LATIHAN034D36109043.Visible = False Then
LATIHAN034D36109043.Show()
Else
LATIHAN034D36109043.Activate()
End If
End Sub
End Class
Komentar ini telah dihapus oleh pengarang.
BalasHapusPublic Class LATIHAN034C36109032
BalasHapusDim sambung As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=jayapura")
Dim misal As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click
If misal.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & T136109032.Text & "','" & T236109032.Text & "'," & Val(T336109032.Text) & "," & Val(T436109032.Text) & ")", sambung)
sambung.Open()
com.ExecuteNonQuery()
sambung.Close()
com.Dispose()
T136109032.Text = ""
T236109032.Text = ""
T336109032.Text = ""
T436109032.Text = ""
End Sub
End Class
Public Class LATIHAN034A36109045
BalasHapusPrivate Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If LATIHAN034B36109047.Visible = False Then
LATIHAN034B36109047.MdiParent = Me.MdiParent
LATIHAN034B36109047.Show()
Else
LATIHAN034B36109045.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 LATIHAN034C36109045.Visible = False Then
LATIHAN034C36109045.MdiParent = Me.MdiParent
LATIHAN034C36109045.Show()
Else
LATIHAN034C36109045.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 ToolStripButton136109045.Click
If LATIHAN034B36109045.Visible = False Then
LATIHAN034B36109045.MdiParent = Me.MdiParent
LATIHAN034B36109045.Show()
Else
LATIHAN034B36109045.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 ToolStripButton236109045.Click
If LATIHAN034C36109045.Visible = False Then
LATIHAN034C36109045.MdiParent = Me.MdiParent
LATIHAN034C36109045.Show()
Else
LATIHAN034C36109045.Activate() 'jika sdh muncul tp dibelakang
End If
End Sub
End Class
Public Class LATIHAN34A36109044
BalasHapusPrivate Sub DAFTARBARANGToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DAFTARBARANGToolStripMenuItem.Click
If LATIHAN34B36109044.Visible = False Then
LATIHAN34B36109044.MdiParent = Me.MdiParent
LATIHAN34B36109044.Show()
Else
LATIHAN34B36109044.Activate()
End If
End Sub
Private Sub INPUTBARANGToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles INPUTBARANGToolStripMenuItem.Click
If LATIHAN34C36109044.Visible = False Then
LATIHAN34C36109044.MdiParent = Me.MdiParent
LATIHAN34C36109044.Show()
Else
LATIHAN34C36109044.Activate()
End If
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
If LATIHAN34B36109044.Visible = False Then
LATIHAN34B36109044.MdiParent = Me.MdiParent
LATIHAN34B36109044.Show()
Else
LATIHAN34B36109044.Activate()
End If
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
If LATIHAN34C36109044.Visible = False Then
LATIHAN34C36109044.MdiParent = Me.MdiParent
LATIHAN34C36109044.Show()
Else
LATIHAN34C36109044.Activate()
End If
End Sub
End Class
Public Class LATIHAN34B36109044
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah")
Dim firah As New DataTable
Public Sub magfirah()
Dim mula As New OleDb.OleDbDataAdapter
mula = New OleDb.OleDbDataAdapter("select * from barang", conect)
firah.Rows.Clear()
mula.Fill(firah)
mula.Dispose()
End Sub
Private Sub LATIHAN34B36109044_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
magfirah()
DataGridView1.DataSource = firah
End Sub
Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
If LATIHAN34C36109044.Visible = False Then
LATIHAN34C36109044.Show()
Else
LATIHAN34C36109044.Activate()
End If
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If LATIHAN34C36109044.Visible = False Then
LATIHAN34C36109044.Show()
Else
LATIHAN34C36109044.Activate()
End If
LATIHAN34C36109044.KB.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
LATIHAN34C36109044.t136109044.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
LATIHAN34C36109044.t236109044.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value
LATIHAN34C36109044.t336109044.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value
LATIHAN34C36109044.t436109044.Text = DataGridView1.CurrentRow.Cells("JUMLAHBARANG").Value()
End Sub
End Class
Public Class LATIHAN34C36109044
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah")
Dim firah As New ByIskandar.CariKeDataBaseByIskandar
Private Sub TAMBAH()
If t136109044.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109044.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109044.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109044.Text) = 0 Then
MsgBox("JUMLAH BELUM TERISI")
Exit Sub
End If
firah.AturPencarianDataBase("barang", "kode barang", t136109044.Text, 1, conect)
If firah.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('" & t136109044.Text & "','" & t236109044.Text & "'," & Val(t336109044.Text) & "," & Val(t436109044.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t136109044.Text = ""
t236109044.Text = ""
t336109044.Text = ""
t436109044.Text = ""
LATIHAN33A36109044.magfirah()
End Sub
Private Sub EDIT()
If t136109044.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109044.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109044.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109044.Text) = 0 Then
MsgBox("JUMLAH BELUM TERISI")
Exit Sub
End If
If KB.Text <> t136109044.Text Then
firah.AturPencarianDataBase("barang", "kode barang", t136109044.Text, 1, conect)
If firah.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 ='" & t136109044.Text & "',namabarang='" & t236109044.Text & "',hargajual=" & Val(t336109044.Text) & ", jumlahbarang=" & Val(t436109044.Text) & "where kodebarang='" & KB.Text & "'", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t136109044.Text = ""
t236109044.Text = ""
t336109044.Text = ""
t436109044.Text = ""
KB.Text = "-"
End Sub
Private Sub Button136109038_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
Public Class LATIHAN_034C_36109056
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=2422")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1_36109056.Text & "','" & t2_36109056.Text & "'," & Val(t3_36109056.Text) & "," & Val(t4_36109056.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t1_36109056.Text = ""
t2_36109056.Text = ""
t3_36109056.Text = ""
t4_36109056.Text = ""
End Sub
End Class
Public Class LATIHAN_034D_36109056
BalasHapusDim cari As New ByIskandar.CariKeDataBaseByIskandar
Dim conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=2422")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t1_36109056.Text, 1, konek)
bie()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1_36109056.Text & "','" & t2_36109056.Text & "'," & Val(t3_36109056.Text) & "," & Val(t4_36109056.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t1_36109056.Text = ""
t2_36109056.Text = ""
t3_36109056.Text = ""
t4_36109056.Text = ""
Else
If ToolStripStatusLabel1.Text <> t1_36109056.Text Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t1_36109056.Text, 1, konek)
bie()
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1_36109056.Text & "', namabarang = '" & t2_36109056.Text & "', hargajual = " & Val(t3_36109056.Text) & ", jumlahbarang = " & Val(t4_36109056.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t1_36109056.Text = ""
t2_36109056.Text = ""
t3_36109056.Text = ""
t4_36109056.Text = ""
End If
End Sub
Public Sub bie()
If cari.JumlanBaris > 0 Then
MsgBox("kode barang telah ada")
t1_36109056.Text = ""
Exit Sub
ElseIf t1_36109056.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf t2_36109056.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf t3_36109056.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf t3_36109056.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
End Sub
End Class
Public Class LATIHAN034D36109032
BalasHapusDim cari As New ByIskandar.CariKeDataBaseByIskandar
Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=jayapura")
Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click
If ToolStripStatusLabel136109032.Text = "KODE BARANG LAMA" Then
misal.AturPencarianDataBase("Barang", "KodeBarang", T136109032.Text, 1, sambung)
speaker()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & T136109032.Text & "','" & T236109032.Text & "'," & Val(T336109032.Text) & "," & Val(T436109032.Text) & ")", sambung)
sambung.Open()
com.ExecuteNonQuery()
sambung.Close()
com.Dispose()
T136109032.Text = ""
T236109032.Text = ""
T336109032.Text = ""
T436109032.Text = ""
Else
If ToolStripStatusLabel136109032.Text <> T136109032.Text Then misal.AturPencarianDataBase("Barang", "KodeBarang", T136109032.Text, 1, sambung)
speaker()
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & T136109032.Text & "', namabarang = '" & T236109032.Text & "', hargajual = " & Val(T336109032.Text) & ", jumlahbarang = " & Val(T 4361090324.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", sambung)
sambung.Open()
com.ExecuteNonQuery()
sambung.Close()
com.Dispose()
T136109032.Text = ""
T236109032.Text = ""
T336109032.Text = ""
T436109032.Text = ""
End If
End Sub
Public Sub speaker()
If misal.JumlanBaris > 0 Then
MsgBox("kode barang telah ada")
T136109032.Text = ""
Exit Sub
ElseIf T136109032.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf T236109032.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf T336109032.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf T336109032.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
End Sub
End Class
Public Class Form34C36109050
BalasHapus'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")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub TAMBAH()
'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
If t1.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If t2.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t3.Text) = 0 Then 'untuk pencarian yg bersifat angka
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t4.Text) = 0 Then
MsgBox("JUMLAH BELUM TERISI")
Exit Sub
End If
cari.AturPencarianDataBase("barang", "kode barang", t1.Text, 1, conect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
conect.Open() 'jembatannya dibuka
com.ExecuteNonQuery() 'jalankan perintahnya
conect.Close() 'tutup jembatan
com.Dispose() 'hancurkan comand
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
Form33A36109050.zaza()
End Sub
Private Sub EDIT()
BalasHapus'untuk mencari jgn sampai data yg akan dimasukkan tidak lengkap
If t1.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub 'jgn lanjut ke proses berikutnya
End If
If t2.Text.Length = 0 Then ' untuk pencarian yg bersifat huruf
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t3.Text) = 0 Then 'untuk pencarian yg bersifat angka
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t4.Text) = 0 Then
MsgBox("JUMLAH BELUM TERISI")
Exit Sub
End If
If KB.Text <> t1.Text Then 'jika kode barang yg akan diganti dengan kode penggantinya tidak sama
cari.AturPencarianDataBase("barang", "kode barang", t1.Text, 1, conect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("update barang set kodebarang ='" & t1.Text & "',namabarang='" & t2.Text & "',hargajual=" & Val(t3.Text) & ", jumlahbarang=" & Val(t4.Text) & "where kodebarang='" & KB.Text & "'", conect)
conect.Open() 'jembatannya dibuka
com.ExecuteNonQuery() 'jalankan perintahnya
conect.Close() 'tutup jembatan
com.Dispose() 'hancurkan comand
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
KB.Text = "-"
Form32A36109050.zaza()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If KB.Text = "-" Then
TAMBAH()
Else
EDIT()
End If
End Sub
End Class
Public Class LATIHAN034C36109053
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=praditya")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
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 ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End Sub
End Class
Public Class Lat34A36109042
BalasHapusPrivate Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click
If Lat34B36109042.Visible = False Then
Lat34B36109042.MdiParent = Me
Lat34B36109042.Show()
Else
Lat34B36109042.Activate()
End If
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click
If Lat34C36109042.Visible = False Then
Lat34C36109042.MdiParent = Me
Lat34C36109042.Show()
Else
Lat34C36109042.Activate()
End If
End Sub
End Class
Public Class Lat34C36109042
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=25")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109042.Click
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109042.Text & "','" & t236109042.Text & "'," & Val(t336109042.Text) & "," & Val(t436109042.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t136109042.Text = ""
t236109042.Text = ""
t336109042.Text = ""
t436109042.Text = ""
End Sub
End Class
Public Class LATIHAN034A36109040
BalasHapusPrivate Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click
If LATIHAN034B036109040.Visible = False Then
LATIHAN034B36109040.MdiParent = Me
LATIHAN034B036109040.Show()
Else
LATIHAN034B36109040.Activate()
End If
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click
If LATIHAN034C36109040.Visible = False Then
LATIHAN034C36109040.MdiParent = Me
LATIHAN034C36109040.Show()
Else
LATIHAN034C36109040.Activate()
End If
End Sub
End Class
Public Class LATIHAN034C36109040
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=150991")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End Sub
End Class
Public Class LATIHAN034D36109040
BalasHapusDim cari As New ByIskandar.CariKeDataBaseByIskandar
Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=150991")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, konek)
gue()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", konek)
konek.Open()
com.ExecuteNonQuery()
konek.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
Else
If ToolStripStatusLabel1.Text <> t1.Text Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, konek)
gue()
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", konek)
konek.Open()
com.ExecuteNonQuery()
konek.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End If
End Sub
Public Sub kha()
If cari.JumlanBaris > 0 Then
MsgBox("kode barang telah ada")
t1.Text = ""
Exit Sub
ElseIf t1.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf t2.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf t3.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf t3.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
End Sub
End Class
Public Class LATIHAN034A36109030
BalasHapusPrivate Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click
If LATIHAN034B36109030.Visible = False Then
LATIHAN034B36109030.MdiParent = Me
LATIHAN034B36109030.Show()
Else
LATIHAN034B36109030.Activate()
End If
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click
If LATIHAN034C36109030.Visible = False Then
LATIHAN034C36109030.MdiParent = Me
LATIHAN034C36109030.Show()
Else
LATIHAN034C36109030.Activate()
End If
End Sub
End Class
Public Class LATIHAN034C36109030
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=sanie")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
'untuk memasukkan data dari visual basic ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End Sub
End Class
Public Class LATIHAN034D_36109037
BalasHapusDim cari As New ByIskandar.CariKeDataBaseByIskandar
Dim Conect As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=2901911691")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t136109037.Text, 1, Conect)
kha()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109037.Text & "','" & t236109037.Text & "'," & Val(t336109037.Text) & "," & Val(t436109037.Text) & ")", Conect)
Conect.Open()
com.ExecuteNonQuery()
Conect.Close()
com.Dispose()
t136109037.Text = ""
t236109037.Text = ""
t336109037.Text = ""
t436109037.Text = ""
Else
If ToolStripStatusLabel1.Text <> t136109037.Text Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t136109037.Text, 1, Conect)
kha()
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t136109037.Text & "', namabarang = '" & t236109037.Text & "', hargajual = " & Val(t336109037.Text) & ", jumlahbarang = " & Val(t436109037.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", Conect)
Conect.Open()
com.ExecuteNonQuery()
Conect.Close()
com.Dispose()
t136109037.Text = ""
t236109037.Text = ""
t336109037.Text = ""
t436109037.Text = ""
End If
End Sub
Public Sub kha()
If cari.JumlanBaris > 0 Then
MsgBox("kode barang telah ada")
t136109037.Text = ""
Exit Sub
ElseIf t136109037.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf t236109037.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf t336109037.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf t336109037.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
End Sub
End Class
Public Class LATIHAN034A36109045
BalasHapusPrivate Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, DAFTARBARANGToolStripMenuItem.Click
If Latihan_034B_36109045.Visible = False Then
Latihan_034B_36109045.MdiParent = Me
Latihan_034B_36109045.Show()
Else
Latihan_034B_36109045.Activate()
End If
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, INPUTBARANGToolStripMenuItem.Click
If Latihan_034C_36109045.Visible = False Then
Latihan_034C_36109045.MdiParent = Me
Latihan_034C_36109045.Show()
Else
Latihan_034C_36109045.Activate()
End If
End Sub
End Class
Public Class Latihan_034C_36109045
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=florista")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
'untuk memasukkan data dari visual basc ke dlm acces
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End Sub
End Class
Public Class Latihan_034D_36109045
BalasHapusDim cari As New ByIskandar.CariKeDataBaseByIskandar
Dim konek As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=florista")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ToolStripStatusLabel1.Text = "KODE BARANG LAMA" Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, konek)
kha()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", konek)
konek.Open()
com.ExecuteNonQuery()
konek.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
Else
If ToolStripStatusLabel1.Text <> t1.Text Then
cari.AturPencarianDataBase("Barang", "KodeBarang", t1.Text, 1, konek)
kha()
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", konek)
konek.Open()
com.ExecuteNonQuery()
konek.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End If
End Sub
Public Sub kha()
If cari.JumlanBaris > 0 Then
MsgBox("kode barang telah ada")
t1.Text = ""
Exit Sub
ElseIf t1.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf t2.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf t3.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf t3.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
End Sub
End Class
http://rizka-azisah.blogspot.com/2012/10/deskripsi-penyelesaian_8439.html
BalasHapushttp://rizka-azisah.blogspot.com/2012/10/deskripsi-penyelesaian_1841.html
http://rizka-azisah.blogspot.com/2012/10/deskripsi-penyelesaian_5460.html
http://andiniwarakusuma.blogspot.com/2012/10/latihan34a36110034.html
BalasHapushttp://andiniwarakusuma.blogspot.com/2012/10/latihan34b36110034.html
http://andiniwarakusuma.blogspot.com/2012/10/latihan34c36110034.html
http://rainaagrippinaa.blogspot.com/#!/2012/10/latihan34a36110032.html
BalasHapushttp://rainaagrippinaa.blogspot.com/#!/2012/10/latihan34b36110032.html
http://rainaagrippinaa.blogspot.com/#!/2012/10/latihan34c36110032.html
http://rosyanausman.blogspot.com/2012/10/latihan34a36110036.html
BalasHapushttp://rosyanausman.blogspot.com/2012/10/latihan34b36110036.html
http://rosyanausman.blogspot.com/2012/10/latihan34b36110036_13.html
http://hasfiahzain.blogspot.com/2012/10/latihan34a36110052.html
BalasHapushttp://hasfiahzain.blogspot.com/2012/10/latihan34b36110052.html
http://hasfiahzain.blogspot.com/2012/10/latihan34c36110052.html
http://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan34a36110037.html
BalasHapushttp://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan34b36110037.html
http://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan34c36110037.html
http://ilhaazzahra.blogspot.com/2012/10/latihan34a36110033.html
BalasHapushttp://ilhaazzahra.blogspot.com/2012/10/latihan34b36110033.html
http://ilhaazzahra.blogspot.com/2012/10/latihan34c36110033.html
http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian-latihan34a36110048.html
BalasHapushttp://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan34a36110048.html
http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian-latihan34b36110048.html
http://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan34b36110048.html
http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian-latihan34c36110048.html
http://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan34c36110048.html
http://03melisa.blogspot.com/2012/10/latihan-34a-36110051-apkom-4-d3b.html
BalasHapushttp://03melisa.blogspot.com/2012/10/latihan-34b-36110051-apkom-4-akuntansi.html
http://03melisa.blogspot.com/2012/10/latihan-34c-36110051-apkom-4-d3b.html
http://burhankhang58.blogspot.com/2012/10/latihan34a36110047.html
BalasHapushttp://burhankhang58.blogspot.com/2012/10/latihan34b36110047.html
http://burhankhang58.blogspot.com/2012/10/latihan34c36110047.html
http://masnurselayar.blogspot.com/2012/10/latihan-34a36110055.html
BalasHapushttp://masnurselayar.blogspot.com/2012/10/latihan-34b36110055.html
http://masnurselayar.blogspot.com/2012/10/latihan-34c36110055.html
http://nurrahmahrasyid2.blogspot.com/2012/10/latihan34a36110042.html
BalasHapushttp://nurrahmahrasyid2.blogspot.com/2012/10/latihan34b36110042.html
http://nurrahmahrasyid2.blogspot.com/2012/10/latihan34c36110042.html
http://tiya-sri.blogspot.com/2012/10/latihan34a36110044-aplikasi-komputer-4.html
BalasHapushttp://tiya-sri.blogspot.com/2012/10/latihan34b36110044-aplikasi-komputer-4.html
http://tiya-sri.blogspot.com/2012/10/latihan34c36110044-aplikasi-komputer-4.html
http://rahmisuryatama05.blogspot.com/2012/10/latihan34a36110040.html
BalasHapushttp://rahmisuryatama05.blogspot.com/2012/10/latihan34b36110040.html
http://rahmisuryatama05.blogspot.com/2012/10/latihan34c36110040_14.html
http://ias-anakbola.blogspot.com/2012/10/latihan34a3611056.html
BalasHapushttp://ias-anakbola.blogspot.com/2012/10/latihan34b36110056.html
http://ias-anakbola.blogspot.com/2012/10/latihan34c36110056.html
http://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur_13.html
BalasHapushttp://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur_6677.html
http://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur_6251.html
http://dewiwahyuni91.blogspot.com/2012/10/latihan34a36110038_11.html
BalasHapushttp://dewiwahyuni91.blogspot.com/2012/10/latihan34b36110038_1573.html
http://dewiwahyuni91.blogspot.com/2012/10/latihan34c36110038.html
http://eminaomi.blogspot.com/2012/10/latihan34a36110049.html
BalasHapushttp://eminaomi.blogspot.com/2012/10/latihan34b36110049.html
http://eminaomi.blogspot.com/2012/10/latihan34c36110049.html
http://zulkiflitryputra.blogspot.com/2012/10/latihan34a36110046.html
BalasHapushttp://zulkiflitryputra.blogspot.com/2012/10/latihan34b36110046.html
http://zulkiflitryputra.blogspot.com/2012/10/latihan34c36110046.html
http://sukadriady.blogspot.com/2012/10/latihan34a36110043.html
BalasHapushttp://sukadriady.blogspot.com/2012/10/latihan34b36110043.html
http://sukadriady.blogspot.com/2012/10/latihan34c36110043.html
http://ruslancullank1.blogspot.com/2012/10/deskripsilatihan34a36110054.html
BalasHapushttp://ruslancullank1.blogspot.com/2012/10/deskripsilatihan34b36110054.html
http://ruslancullank1.blogspot.com/2012/10/deskripsilatihan34c36110054.html
http://nurhanalott.blogspot.com/2012/10/latihan34a36110029.html
BalasHapushttp://nurhanalott.blogspot.com/2012/10/latihan34b36110029.html
http://nurhanalott.blogspot.com/2012/10/latihan34c36110029.html