Public Class Latihan031A_054 Dim MUSTIKA As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=MUSTIKA CHAERUNNISA") Dim ambil As New DataTable
Public Sub ambildata() Dim data As New OleDb.OleDbDataAdapter data = New OleDb.OleDbDataAdapter("SELECT* FROM BARANG", MUSTIKA) ambil.Rows.Clear() data.Fill(ambil) data.Dispose() End Sub
Private Sub Latihan031A_054_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() DGV_054.DataSource = ambil End Sub
Private Sub Dwi1_054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dwi1_054.Click If LATIHAN_031B_054.Visible = False Then LATIHAN_031B_054.Show() Else LATIHAN_031B_054.Activate() End If
Public NotInheritable Class form31a_46109045 Dim dewi As New DataTable Dim sartika As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub edit_46109045_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_46109045.Click If form31b_46109045.Visible = False Then form31b_46109045.Show() Else form31b_46109045.Activate() End If form31b_46109045.kbl_46109045.Text = dgv_46109045.CurrentRow.Cells("kodebarang").Value form31b_46109045.kb_46109045.Text = dgv_46109045.CurrentRow.Cells("kodebarang").Value form31b_46109045.nb_46109045.Text = dgv_46109045.CurrentRow.Cells("namabarang").Value form31b_46109045.jb_46109045.Text = dgv_46109045.CurrentRow.Cells("jumlahbarang").Value form31b_46109045.hj_46109045.Text = dgv_46109045.CurrentRow.Cells("hargajual").Value End Sub
Private Sub form31a_46109045_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim adapter As New OleDb.OleDbDataAdapter adapter = New OleDb.OleDbDataAdapter("select * from barang", sartika) dewi.Rows.Clear() adapter.Fill(dewi) adapter.Dispose() dgv_46109045.DataSource = dewi End Sub End Class
Public NotInheritable Class form31b_46109045 Dim chiko As New ByIskandar.CariKeDataBaseByIskandar Dim dewi As New OleDb.OleDbCommand Dim sartika As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If kbl_46109045.Text <> kb_46109045.Text Then chiko.AturPencarianDataBase("Barang", "KodeBarang", kb_46109045.Text, 1, sartika) If saenong.JumlanBaris > 0 Then MsgBox("kode barang tidak dapat diupdate") Exit Sub End If End If If kb_46109045.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf nb_46109045Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf hj_46109045.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf jb_46109045.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If Dim ikha As String = "update barang set kodebarang = '" & kb_46109045.Text & "', namabarang = '" & nb_46109045.Text & "', hargajual = " & Val(hj_46109045.Text) & ", jumlahbarang = " & Val(jb_46109045.Text) & " where kodebarang = '" & kbl_46109045.Text & "'" dewi = New OleDb.OleDbCommand(ikha, sartika) sartika.Open() dewi.ExecuteNonQuery() sartika.Close() dewi.Dispose() kbl_46109045.Text = "-" kb_46109045.Text = "" nb_46109045.Text = "" hj_46109045.Text = "" jb_46109045.Text = "" End Sub
Dim dwitya As New OleDb.OleDbCommand Dim saadah As New ByIskandar.CariKeDataBaseByIskandar Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
Private Sub S46109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109001.Click If KB46109001.Text.Length = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
If NB46109001.Text.Length = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
If Val(HJ46109001.Text) = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
If Val(JB46109001.Text) = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
saadah.AturPencarianDataBase("Barang", "KodeBarang", KB46109001.Text, 1, conect) If saadah.JumlanBaris > 0 Then MsgBox("kode barang telah ada ") Exit Sub End If
Public Class Latihan031A_46109008 Dim jembatan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=46109008") Dim ambil As New DataTable Public Sub ambildata() Dim data As New OleDb.OleDbDataAdapter data = New OleDb.OleDbDataAdapter("SELECT* FROM barang", jembatan) ambil.Rows.Clear() data.Fill(ambil) data.Dispose() End Sub Private Sub Latihan31_A_46109008_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() DGV_46109008.DataSource = ambil End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_46109008.Click If Latihan031B_46109008.Visible = False Then Latihan031B_46109008.Show() Else Latihan031B_46109008.Activate() End If Latihan031B_46109008.KB.Text = DGV_46109008.CurrentRow.Cells("KODEBARANG").Value Latihan031B_46109008.KB_46109008.Text = DGV_46109008.CurrentRow.Cells("KODEBARANG").Value Latihan031B_46109008.NB_46109008.Text = DGV_46109008.CurrentRow.Cells("NAMABARANG").Value Latihan031B_46109008.HJ_46109008.Text = DGV_46109008.CurrentRow.Cells("HARGAJUAL").Value Latihan031B_46109008.JB_46109008.Text = DGV_46109008.CurrentRow.Cells("JUMLAHBARANG").Value End Sub End Class
Public Class Latihan031B_46109008 Dim jembatan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=46109008")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_46109008.Click If KB_46109008.Text.Length = 0 Then MsgBox("Please insert your text") Exit Sub End If If NB_46109008.Text.Length = 0 Then MsgBox("Please insert your text") Exit Sub End If If Val(HJ_46109008.Text) = 0 Then MsgBox("Please insert your text") Exit Sub End If If Val(JB_46109008.Text) = 0 Then MsgBox("Please insert your text") Exit Sub End If
If KB.Text <> KB_46109008.Text Then Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", KB_46109008.Text, 1, jembatan) If PENCARI.JumlanBaris > 0 Then MsgBox("the data has been exist please insert new data") KB_46109008.Text = "" NB_46109008.Text = "" HJ_46109008.Text = "" JB_46109008.Text = "" Exit Sub End If End If
Dim Cmd As New OleDb.OleDbCommand Cmd = New OleDb.OleDbCommand("update BARANG set KODEBARANG ='" & KB_46109008.Text & "', NAMABARANG = '" & NB_46109008.Text & "', HARGAJUAL=" & Val(HJ_46109008.Text) & ", JUMLAHBARANG=" & Val(JB_46109008.Text) & " where KODEBARANG='" & KB.Text & "'", jembatan) jembatan.Open() Cmd.ExecuteNonQuery() jembatan.Close() Cmd.Dispose()
Public NotInheritable Class Form31A Dim FADILLAH As New DataTable Dim SAGENA As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub edit_46109059_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_46109059.Click If Form31B.Visible = False Then Form31B.Show() Else Form31B.Activate() End If Form31B.DILA1_46109059.Text = UDHE_46109059.CurrentRow.Cells("kodebarang").Value Form31B.DILA2_46109059.Text = UDHE_46109059.CurrentRow.Cells("kodebarang").Value Form31B.DILA3_46109059.Text = UDHE_46109059.CurrentRow.Cells("namabarang").Value Form31B.DILA4_46109059.Text = UDHE_46109059.CurrentRow.Cells("jumlahbarang").Value Form31B DILA5_46109059.Text = UDHE_46109059.CurrentRow.Cells("hargajual").Value End Sub
Private Sub Form31A _Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim adapter As New OleDb.OleDbDataAdapter adapter = New OleDb.OleDbDataAdapter("select * from barang", SAGENA) FADILLAH.Rows.Clear() adapter.Fill(FADILLAH) adapter.Dispose() UDHE_46109059.DataSource = FADILLAH End Sub End Class
Public NotInheritable Class Form31B Dim DAUDE As New ByIskandar.CariKeDataBaseByIskandar Dim FADILLAH As New OleDb.OleDbCommand Dim SAGENA As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If DILA1_46109059.Text <> DILA2_46109059.Text Then DAUDE.AturPencarianDataBase("Barang", "KodeBarang", DILA2_46109059.Text, 1, SAGENA) If DAUDE.JumlahBaris > 0 Then MsgBox("kode barang tidak dapat diupdate") Exit Sub End If End If If DILA2_46109059.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf DILA3_46109059.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf DILA5_46109059.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf DILA4_46109059.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If Dim DILA As String = "update barang set kodebarang = '" & DILA2_46109059.Text & "', namabarang = '" & DILA3_46109059.Text & "', hargajual = " & Val(DILA5_46109059.Text) & ", jumlahbarang = " & Val(DILA4_46109059.Text) & " where kodebarang = '" & DILA1_46109059.Text & "'" FADILLAH = New OleDb.OleDbCommand(DILA, SAGENA) SAGENA.Open() FADILLAH.ExecuteNonQuery() SAGENA.Close() FADILLAH.Dispose() DILA1_46109059.Text = "-" DILA2_46109059.Text = "" DILA3_46109059.Text = "" DILA5_46109059.Text = "" DILA4_46109059.Text = "" End Sub
Dim ismi As New OleDb.OleDbCommand Dim sri As New ByIskandar.CariKeDataBaseByIskandar Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click If KB46109023.Text.Length = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
If NB46109023.Text.Length = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
If Val(HJ46109023.Text) = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
If Val(JB46109023.Text) = 0 Then MsgBox("Isi yang kosong") Exit Sub End If
sri.AturPencarianDataBase("Barang", "KodeBarang", KB46109023.Text, 1, conect) If sri.JumlanBaris > 0 Then MsgBox("kode barang telah ada ") Exit Sub End If
ismi = New OleDb.OleDbCommand("update barang set kodebarang = '" & KB46109023.Text & "', namabarang = '" & NB46109023.Text & "', hargajual = " & Val(HJ46109023.Text) & ", jumlahbarang = " & Val(JB46109023.Text) & " where kodebarang = '" & KKB46109023.Text & "'", conect)
Public NotInheritable Class form31a_46109053 Dim indah As New DataTable Dim yani As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub edit_46109053_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_46109053.Click If form31b_46109053.Visible = False Then form31b_46109053.Show() Else form31b_46109053.Activate() End If form31b_46109053.kbl_46109053.Text = dgv_46109053.CurrentRow.Cells("kodebarang").Value form31b_46109053.kb_46109053.Text = dgv_46109053.CurrentRow.Cells("kodebarang").Value form31b_46109053.nb_46109053.Text = dgv_46109053.CurrentRow.Cells("namabarang").Value form31b_46109053.jb_46109053.Text = dgv_46109053.CurrentRow.Cells("jumlahbarang").Value form31b_46109053.hj_46109053.Text = dgv_46109053.CurrentRow.Cells("hargajual").Value End Sub
Private Sub form31a_46109053_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim adapter As New OleDb.OleDbDataAdapter adapter = New OleDb.OleDbDataAdapter("select * from barang", yani) indah.Rows.Clear() adapter.Fill(indah) adapter.Dispose() dgv_46109053.DataSource = indah End Sub End Class
Public NotInheritable Class form31b_46109053 Dim saenong As New ByIskandar.CariKeDataBaseByIskandar Dim indah As New OleDb.OleDbCommand Dim yani As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If kbl_46109053.Text <> kb_46109053.Text Then saenong.AturPencarianDataBase("Barang", "KodeBarang", kb_46109053.Text, 1, yani) If saenong.JumlanBaris > 0 Then MsgBox("kode barang tidak dapat diupdate") Exit Sub End If End If If kb_46109053.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf nb_46109053.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf hj_46109053.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf jb_46109053.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If Dim sae As String = "update barang set kodebarang = '" & kb_46109053.Text & "', namabarang = '" & nb_46109053.Text & "', hargajual = " & Val(hj_46109053.Text) & ", jumlahbarang = " & Val(jb_46109053.Text) & " where kodebarang = '" & kbl_46109053.Text & "'" indah = New OleDb.OleDbCommand(sae, yani) yani.Open() indah.ExecuteNonQuery() yani.Close() indah.Dispose() kbl_46109053.Text = "-" kb_46109053.Text = "" nb_46109053.Text = "" hj_46109053.Text = "" jb_46109053.Text = "" End Sub End class
Public Class Latihan031A46109017 Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=putri") Dim ayu As New DataTable Private Sub latihan1546109017_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cobajaa As New OleDb.OleDbDataAdapter cobajaa = New OleDb.OleDbDataAdapter("select * from barang", CONECT) cobajaa.Fill(ayu) DataGridView1.DataSource = ayu End Sub Private Sub Button146109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button146109017.Click If Latihan031B46109017.Visible = False Then Latihan031B46109017.Show() Else Latihan031B46109017.Activate() End If Latihan031B46109017.t146109017.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value Latihan031B46109017.ToolStripStatusLabel1.Text = "kode barang lama = " & DataGridView1.CurrentRow.Cells("KodeBarang").Value Latihan031B46109017.t246109017.Text = DataGridView1.CurrentRow.Cells("NamaBarang").Value Latihan031B46109017.t346109017.Text = DataGridView1.CurrentRow.Cells("Hargajual").Value Latihan031B46109017.t446109017.Text = DataGridView1.CurrentRow.Cells("jumlahbarang").Value End Sub
End Class
Public Class Latihan031B46109017 Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=putri") Private Sub Button146109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button146109017.Click
If Val(t146109017.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t246109017.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t346109017.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t446109017.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t146109017.Text & "', namabarang = '" & t246109017.Text & "', hargajual = " & Val(t346109017.Text) & ", jumlahbarang = " & Val(t446109017.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", CONECT)
Public NotInheritable Class LATIHAN031A_46109027 Dim FEBIANA As New DataTable Dim ana As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub edit_46109027_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_46109027.Click If LATIHAN31b_46109027.Visible = False Then LATIHAN31b_46109027.Show() Else LATIHAN31b_46109027.Activate() End If LATIHAN31b_46109027.KBL_46109027.Text = dgv_46109027.CurrentRow.Cells("kodebarang").Value LATIHAN31b_46109027.KB_46109027.Text = dgv_46109027.CurrentRow.Cells("kodebarang").Value LATIHAN31b_46109027.NB_46109027.Text = dgv_46109027.CurrentRow.Cells("namabarang").Value LATIHAN31b_46109027.JB_46109027.Text = dgv_46109027.CurrentRow.Cells("jumlahbarang").Value LATIHAN31b_46109027.HJ_46109027.Text = dgv_46109027.CurrentRow.Cells("hargajual").Value End Sub
Private Sub LATIHAN31a_46109027_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim adapter As New OleDb.OleDbDataAdapter adapter = New OleDb.OleDbDataAdapter("select * from barang", ana) FEBIANA.Rows.Clear() adapter.Fill(FEBIANA) adapter.Dispose() dgv_46109027.DataSource = FEBIANA End Sub End Class
Public NotInheritable Class LATIHAN31b_46109027 Dim fransiskus As New ByIskandar.CariKeDataBaseByIskandar Dim FEBIANA As New OleDb.OleDbCommand Dim ana As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If KBL_46109027.Text <> KB_46109027.Text Then fransiskus.AturPencarianDataBase("Barang", "KodeBarang", KB_46109027.Text, 1, ana) If fransiskus.JumlaNBaris > 0 Then MsgBox("kode barang tidak dapat diupdate") Exit Sub End If End If If KB_46109027.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf NB_46109027.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf HJ_46109027.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf JB_46109027.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If Dim FEBY As String = "update barang set kodebarang = '" & KB_46109027.Text & "', namabarang = '" & NB_46109027.Text & "', hargajual = " & Val(HJ_46109027.Text) & ", jumlahbarang = " & Val(JB_46109027.Text) & " where kodebarang = '" & KBL_46109027.Text & "'" FEBIANA = New OleDb.OleDbCommand(FEBY, ana) ana.Open() FEBIANA.ExecuteNonQuery() ana.Close() FEBIANA.Dispose() KBL_46109027.Text = "-" KB_46109027.Text = "" NB_46109027.Text = "" HJ_46109027.Text = "" JB_46109027.Text = "" End Sub
LATIHAN31A_46109051 Public Class LATIHAN31A_46109051 Dim nia As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=WAHDANIAH") Dim GO As New DataTable Public Sub ambildata() Dim data As New OleDb.OleDbDataAdapter data = New OleDb.OleDbDataAdapter("SELECT* FROM barang", nia) GO.Rows.Clear() data.Fill(GO) data.Dispose() End Sub
Private Sub LATIHAN31A_46109051_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() dg46109051.DataSource = GO End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If LATIHAN31B_46109051.Visible = False Then LATIHAN31B_46109051.Show() Else LATIHAN31B_46109051.Activate() End If LATIHAN31B_46109051.KB.Text = dg46109051.CurrentRow.Cells("KODEBARANG").Value LATIHAN31B_46109051.TB146109051.Text = dg46109051.CurrentRow.Cells("KODEBARANG").Value LATIHAN31B_46109051.TB246109051.Text = dg46109051.CurrentRow.Cells("NAMABARANG").Value LATIHAN31B_46109051.TB346109051.Text = dg46109051.CurrentRow.Cells("HARGAJUAL").Value LATIHAN31B_46109051.TB446109051.Text = dg46109051.CurrentRow.Cells("JUMLAHBARANG").Value End Sub End Class
LATIHAN31B_46109051 Public Class LATIHAN31B_46109051 Dim nia As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=WAHDANIAH") Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TB146109051.Text.Length = 0 Then MsgBox("Please insert your text") Exit Sub End If If TB246109051.Text.Length = 0 Then MsgBox("Please insert your text") Exit Sub End If If Val(TB346109051.Text) = 0 Then MsgBox("Please insert your text") Exit Sub End If If Val(TB446109051.Text) = 0 Then MsgBox("Please insert your text") Exit Sub End If If KB.Text <> TB146109051.Text Then Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar PENCARI.AturPencarianDataBase("BARANG","KODEBARANG", TB146109051.Text, 1, nia) If PENCARI.JumlanBaris > 0 Then MsgBox("the data has been exist please insert new data") TB146109051.Text = "" TB246109051.Text = "" TB346109051.Text = "" TB446109051.Text = "" Exit Sub End If End If Dim Cm As New OleDb.OleDbCommand Cm = New OleDb.OleDbCommand("update BARANG set KODEBARANG ='" & TB146109051.Text & "', NAMABARANG = '" & TB246109051.Text & "', HARGAJUAL=" & Val(TB346109051.Text) & ", JUMLAHBARANG=" & Val(TB446109051.Text) & " where KODEBARANG='" & KB.Text & "'", nia) nia.Open() Cm.ExecuteNonQuery() nia.Close() Cm.Dispose()
KB.Text = "" TB146109051.Text = "" TB246109051.Text = "" TB346109051.Text = "" TB446109051.Text = "" LATIHAN31A_46109051.ambildata() Me.Close() End Sub End Class
Komentar ini telah dihapus oleh pengarang.
BalasHapusKomentar ini telah dihapus oleh pengarang.
BalasHapusPublic Class Latihan031A_054
BalasHapusDim MUSTIKA As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=MUSTIKA CHAERUNNISA")
Dim ambil As New DataTable
Public Sub ambildata()
Dim data As New OleDb.OleDbDataAdapter
data = New OleDb.OleDbDataAdapter("SELECT* FROM BARANG", MUSTIKA)
ambil.Rows.Clear()
data.Fill(ambil)
data.Dispose()
End Sub
Private Sub Latihan031A_054_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
DGV_054.DataSource = ambil
End Sub
Private Sub Dwi1_054_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dwi1_054.Click
If LATIHAN_031B_054.Visible = False Then
LATIHAN_031B_054.Show()
Else
LATIHAN_031B_054.Activate()
End If
End Sub
End Class
dewi sartika
BalasHapus461 09 045
3a,d4
Public NotInheritable Class form31a_46109045
Dim dewi As New DataTable
Dim sartika As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub edit_46109045_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_46109045.Click
If form31b_46109045.Visible = False Then
form31b_46109045.Show()
Else
form31b_46109045.Activate()
End If
form31b_46109045.kbl_46109045.Text = dgv_46109045.CurrentRow.Cells("kodebarang").Value
form31b_46109045.kb_46109045.Text = dgv_46109045.CurrentRow.Cells("kodebarang").Value
form31b_46109045.nb_46109045.Text = dgv_46109045.CurrentRow.Cells("namabarang").Value
form31b_46109045.jb_46109045.Text = dgv_46109045.CurrentRow.Cells("jumlahbarang").Value
form31b_46109045.hj_46109045.Text = dgv_46109045.CurrentRow.Cells("hargajual").Value
End Sub
Private Sub form31a_46109045_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim adapter As New OleDb.OleDbDataAdapter
adapter = New OleDb.OleDbDataAdapter("select * from barang", sartika)
dewi.Rows.Clear()
adapter.Fill(dewi)
adapter.Dispose()
dgv_46109045.DataSource = dewi
End Sub
End Class
Public NotInheritable Class form31b_46109045
BalasHapusDim chiko As New ByIskandar.CariKeDataBaseByIskandar
Dim dewi As New OleDb.OleDbCommand
Dim sartika As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If kbl_46109045.Text <> kb_46109045.Text Then
chiko.AturPencarianDataBase("Barang", "KodeBarang", kb_46109045.Text, 1, sartika)
If saenong.JumlanBaris > 0 Then
MsgBox("kode barang tidak dapat diupdate")
Exit Sub
End If
End If
If kb_46109045.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf nb_46109045Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf hj_46109045.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf jb_46109045.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
Dim ikha As String = "update barang set kodebarang = '" & kb_46109045.Text & "', namabarang = '" & nb_46109045.Text & "', hargajual = " & Val(hj_46109045.Text) & ", jumlahbarang = " & Val(jb_46109045.Text) & " where kodebarang = '" & kbl_46109045.Text & "'"
dewi = New OleDb.OleDbCommand(ikha, sartika)
sartika.Open()
dewi.ExecuteNonQuery()
sartika.Close()
dewi.Dispose()
kbl_46109045.Text = "-"
kb_46109045.Text = ""
nb_46109045.Text = ""
hj_46109045.Text = ""
jb_46109045.Text = ""
End Sub
Public Class Latihan31B_46109001
BalasHapusDim dwitya As New OleDb.OleDbCommand
Dim saadah As New ByIskandar.CariKeDataBaseByIskandar
Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
Private Sub S46109001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109001.Click
If KB46109001.Text.Length = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
If NB46109001.Text.Length = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
If Val(HJ46109001.Text) = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
If Val(JB46109001.Text) = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
saadah.AturPencarianDataBase("Barang", "KodeBarang", KB46109001.Text, 1, conect)
If saadah.JumlanBaris > 0 Then
MsgBox("kode barang telah ada ")
Exit Sub
End If
dwitya = New OleDb.OleDbCommand("update barang set kodebarang = '" & KB46109001.Text & "', namabarang = '" & NB46109001.Text & "', hargajual = " & Val(HJ46109001.Text) & ", jumlahbarang = " & Val(JB46109001.Text) & " where kodebarang = '" & KKB46109001.Text & "'", conect)
conect.Open()
dwitya.ExecuteNonQuery()
conect.Close()
dwitya.Dispose()
KB46109001.Text = ""
NB46109001.Text = ""
HJ46109001.Text = ""
JB46109001.Text = ""
KKB46109001.Text = "-"
End Sub
End Class
Public Class Latihan031A_46109008
BalasHapusDim jembatan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=46109008")
Dim ambil As New DataTable
Public Sub ambildata()
Dim data As New OleDb.OleDbDataAdapter
data = New OleDb.OleDbDataAdapter("SELECT* FROM barang", jembatan)
ambil.Rows.Clear()
data.Fill(ambil)
data.Dispose()
End Sub
Private Sub Latihan31_A_46109008_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
DGV_46109008.DataSource = ambil
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_46109008.Click
If Latihan031B_46109008.Visible = False Then
Latihan031B_46109008.Show()
Else
Latihan031B_46109008.Activate()
End If
Latihan031B_46109008.KB.Text = DGV_46109008.CurrentRow.Cells("KODEBARANG").Value
Latihan031B_46109008.KB_46109008.Text = DGV_46109008.CurrentRow.Cells("KODEBARANG").Value
Latihan031B_46109008.NB_46109008.Text = DGV_46109008.CurrentRow.Cells("NAMABARANG").Value
Latihan031B_46109008.HJ_46109008.Text = DGV_46109008.CurrentRow.Cells("HARGAJUAL").Value
Latihan031B_46109008.JB_46109008.Text = DGV_46109008.CurrentRow.Cells("JUMLAHBARANG").Value
End Sub
End Class
Public Class Latihan031B_46109008
BalasHapusDim jembatan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=46109008")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_46109008.Click
If KB_46109008.Text.Length = 0 Then
MsgBox("Please insert your text")
Exit Sub
End If
If NB_46109008.Text.Length = 0 Then
MsgBox("Please insert your text")
Exit Sub
End If
If Val(HJ_46109008.Text) = 0 Then
MsgBox("Please insert your text")
Exit Sub
End If
If Val(JB_46109008.Text) = 0 Then
MsgBox("Please insert your text")
Exit Sub
End If
If KB.Text <> KB_46109008.Text Then
Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", KB_46109008.Text, 1, jembatan)
If PENCARI.JumlanBaris > 0 Then
MsgBox("the data has been exist please insert new data")
KB_46109008.Text = ""
NB_46109008.Text = ""
HJ_46109008.Text = ""
JB_46109008.Text = ""
Exit Sub
End If
End If
Dim Cmd As New OleDb.OleDbCommand
Cmd = New OleDb.OleDbCommand("update BARANG set KODEBARANG ='" & KB_46109008.Text & "', NAMABARANG = '" & NB_46109008.Text & "', HARGAJUAL=" & Val(HJ_46109008.Text) & ", JUMLAHBARANG=" & Val(JB_46109008.Text) & " where KODEBARANG='" & KB.Text & "'", jembatan)
jembatan.Open()
Cmd.ExecuteNonQuery()
jembatan.Close()
Cmd.Dispose()
KB.Text = ""
KB_46109008.Text = ""
NB_46109008.Text = ""
HJ_46109008.Text = ""
JB_46109008.Text = ""
Latihan031A_46109008.ambildata()
Me.Close()
End Sub
End Class
Public NotInheritable Class Form31A
BalasHapusDim FADILLAH As New DataTable
Dim SAGENA As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub edit_46109059_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_46109059.Click
If Form31B.Visible = False Then
Form31B.Show()
Else
Form31B.Activate()
End If
Form31B.DILA1_46109059.Text = UDHE_46109059.CurrentRow.Cells("kodebarang").Value
Form31B.DILA2_46109059.Text = UDHE_46109059.CurrentRow.Cells("kodebarang").Value
Form31B.DILA3_46109059.Text = UDHE_46109059.CurrentRow.Cells("namabarang").Value
Form31B.DILA4_46109059.Text = UDHE_46109059.CurrentRow.Cells("jumlahbarang").Value
Form31B DILA5_46109059.Text = UDHE_46109059.CurrentRow.Cells("hargajual").Value
End Sub
Private Sub Form31A _Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim adapter As New OleDb.OleDbDataAdapter
adapter = New OleDb.OleDbDataAdapter("select * from barang", SAGENA)
FADILLAH.Rows.Clear()
adapter.Fill(FADILLAH)
adapter.Dispose()
UDHE_46109059.DataSource = FADILLAH
End Sub
End Class
Public NotInheritable Class Form31B
Dim DAUDE As New ByIskandar.CariKeDataBaseByIskandar
Dim FADILLAH As New OleDb.OleDbCommand
Dim SAGENA As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If DILA1_46109059.Text <> DILA2_46109059.Text Then
DAUDE.AturPencarianDataBase("Barang", "KodeBarang", DILA2_46109059.Text, 1, SAGENA)
If DAUDE.JumlahBaris > 0 Then
MsgBox("kode barang tidak dapat diupdate")
Exit Sub
End If
End If
If DILA2_46109059.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf DILA3_46109059.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf DILA5_46109059.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf DILA4_46109059.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
Dim DILA As String = "update barang set kodebarang = '" & DILA2_46109059.Text & "', namabarang = '" & DILA3_46109059.Text & "', hargajual = " & Val(DILA5_46109059.Text) & ", jumlahbarang = " & Val(DILA4_46109059.Text) & " where kodebarang = '" & DILA1_46109059.Text & "'"
FADILLAH = New OleDb.OleDbCommand(DILA, SAGENA)
SAGENA.Open()
FADILLAH.ExecuteNonQuery()
SAGENA.Close()
FADILLAH.Dispose()
DILA1_46109059.Text = "-"
DILA2_46109059.Text = ""
DILA3_46109059.Text = ""
DILA5_46109059.Text = ""
DILA4_46109059.Text = ""
End Sub
Public Class Latihan31B_46109023
BalasHapusDim ismi As New OleDb.OleDbCommand
Dim sri As New ByIskandar.CariKeDataBaseByIskandar
Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
Private Sub S46109023_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109023.Click
If KB46109023.Text.Length = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
If NB46109023.Text.Length = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
If Val(HJ46109023.Text) = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
If Val(JB46109023.Text) = 0 Then
MsgBox("Isi yang kosong")
Exit Sub
End If
sri.AturPencarianDataBase("Barang", "KodeBarang", KB46109023.Text, 1, conect)
If sri.JumlanBaris > 0 Then
MsgBox("kode barang telah ada ")
Exit Sub
End If
ismi = New OleDb.OleDbCommand("update barang set kodebarang = '" & KB46109023.Text & "', namabarang = '" & NB46109023.Text & "', hargajual = " & Val(HJ46109023.Text) & ", jumlahbarang = " & Val(JB46109023.Text) & " where kodebarang = '" & KKB46109023.Text & "'", conect)
conect.Open()
ismi.ExecuteNonQuery()
conect.Close()
ismi.Dispose()
KB46109023.Text = ""
NB46109023.Text = ""
HJ46109023.Text = ""
JB46109023.Text = ""
KKB46109023.Text = "-"
End Sub
End Class
Public NotInheritable Class form31a_46109053
BalasHapusDim indah As New DataTable
Dim yani As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub edit_46109053_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_46109053.Click
If form31b_46109053.Visible = False Then
form31b_46109053.Show()
Else
form31b_46109053.Activate()
End If
form31b_46109053.kbl_46109053.Text = dgv_46109053.CurrentRow.Cells("kodebarang").Value
form31b_46109053.kb_46109053.Text = dgv_46109053.CurrentRow.Cells("kodebarang").Value
form31b_46109053.nb_46109053.Text = dgv_46109053.CurrentRow.Cells("namabarang").Value
form31b_46109053.jb_46109053.Text = dgv_46109053.CurrentRow.Cells("jumlahbarang").Value
form31b_46109053.hj_46109053.Text = dgv_46109053.CurrentRow.Cells("hargajual").Value
End Sub
Private Sub form31a_46109053_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim adapter As New OleDb.OleDbDataAdapter
adapter = New OleDb.OleDbDataAdapter("select * from barang", yani)
indah.Rows.Clear()
adapter.Fill(indah)
adapter.Dispose()
dgv_46109053.DataSource = indah
End Sub
End Class
Public NotInheritable Class form31b_46109053
BalasHapusDim saenong As New ByIskandar.CariKeDataBaseByIskandar
Dim indah As New OleDb.OleDbCommand
Dim yani As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If kbl_46109053.Text <> kb_46109053.Text Then
saenong.AturPencarianDataBase("Barang", "KodeBarang", kb_46109053.Text, 1, yani)
If saenong.JumlanBaris > 0 Then
MsgBox("kode barang tidak dapat diupdate")
Exit Sub
End If
End If
If kb_46109053.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf nb_46109053.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf hj_46109053.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf jb_46109053.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
Dim sae As String = "update barang set kodebarang = '" & kb_46109053.Text & "', namabarang = '" & nb_46109053.Text & "', hargajual = " & Val(hj_46109053.Text) & ", jumlahbarang = " & Val(jb_46109053.Text) & " where kodebarang = '" & kbl_46109053.Text & "'"
indah = New OleDb.OleDbCommand(sae, yani)
yani.Open()
indah.ExecuteNonQuery()
yani.Close()
indah.Dispose()
kbl_46109053.Text = "-"
kb_46109053.Text = ""
nb_46109053.Text = ""
hj_46109053.Text = ""
jb_46109053.Text = ""
End Sub
End class
Public Class Latihan031A46109017
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=putri")
Dim ayu As New DataTable
Private Sub latihan1546109017_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cobajaa As New OleDb.OleDbDataAdapter
cobajaa = New OleDb.OleDbDataAdapter("select * from barang", CONECT)
cobajaa.Fill(ayu)
DataGridView1.DataSource = ayu
End Sub
Private Sub Button146109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button146109017.Click
If Latihan031B46109017.Visible = False Then
Latihan031B46109017.Show()
Else
Latihan031B46109017.Activate()
End If
Latihan031B46109017.t146109017.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
Latihan031B46109017.ToolStripStatusLabel1.Text = "kode barang lama = " & DataGridView1.CurrentRow.Cells("KodeBarang").Value
Latihan031B46109017.t246109017.Text = DataGridView1.CurrentRow.Cells("NamaBarang").Value
Latihan031B46109017.t346109017.Text = DataGridView1.CurrentRow.Cells("Hargajual").Value
Latihan031B46109017.t446109017.Text = DataGridView1.CurrentRow.Cells("jumlahbarang").Value
End Sub
End Class
Public Class Latihan031B46109017
Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=putri")
Private Sub Button146109017_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button146109017.Click
If Val(t146109017.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t246109017.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t346109017.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t446109017.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t146109017.Text & "', namabarang = '" & t246109017.Text & "', hargajual = " & Val(t346109017.Text) & ", jumlahbarang = " & Val(t446109017.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
t146109017.Text = ""
t246109017.Text = ""
t346109017.Text = ""
t446109017.Text = ""
End Sub
End Class
nama : febiana fransiskus
BalasHapusstmbk :46109027
Public NotInheritable Class LATIHAN031A_46109027
Dim FEBIANA As New DataTable
Dim ana As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub edit_46109027_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_46109027.Click
If LATIHAN31b_46109027.Visible = False Then
LATIHAN31b_46109027.Show()
Else
LATIHAN31b_46109027.Activate()
End If
LATIHAN31b_46109027.KBL_46109027.Text = dgv_46109027.CurrentRow.Cells("kodebarang").Value
LATIHAN31b_46109027.KB_46109027.Text = dgv_46109027.CurrentRow.Cells("kodebarang").Value
LATIHAN31b_46109027.NB_46109027.Text = dgv_46109027.CurrentRow.Cells("namabarang").Value
LATIHAN31b_46109027.JB_46109027.Text = dgv_46109027.CurrentRow.Cells("jumlahbarang").Value
LATIHAN31b_46109027.HJ_46109027.Text = dgv_46109027.CurrentRow.Cells("hargajual").Value
End Sub
Private Sub LATIHAN31a_46109027_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim adapter As New OleDb.OleDbDataAdapter
adapter = New OleDb.OleDbDataAdapter("select * from barang", ana)
FEBIANA.Rows.Clear()
adapter.Fill(FEBIANA)
adapter.Dispose()
dgv_46109027.DataSource = FEBIANA
End Sub
End Class
Public NotInheritable Class LATIHAN31b_46109027
Dim fransiskus As New ByIskandar.CariKeDataBaseByIskandar
Dim FEBIANA As New OleDb.OleDbCommand
Dim ana As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb'")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If KBL_46109027.Text <> KB_46109027.Text Then
fransiskus.AturPencarianDataBase("Barang", "KodeBarang", KB_46109027.Text, 1, ana)
If fransiskus.JumlaNBaris > 0 Then
MsgBox("kode barang tidak dapat diupdate")
Exit Sub
End If
End If
If KB_46109027.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf NB_46109027.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf HJ_46109027.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf JB_46109027.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
Dim FEBY As String = "update barang set kodebarang = '" & KB_46109027.Text & "', namabarang = '" & NB_46109027.Text & "', hargajual = " & Val(HJ_46109027.Text) & ", jumlahbarang = " & Val(JB_46109027.Text) & " where kodebarang = '" & KBL_46109027.Text & "'"
FEBIANA = New OleDb.OleDbCommand(FEBY, ana)
ana.Open()
FEBIANA.ExecuteNonQuery()
ana.Close()
FEBIANA.Dispose()
KBL_46109027.Text = "-"
KB_46109027.Text = ""
NB_46109027.Text = ""
HJ_46109027.Text = ""
JB_46109027.Text = ""
End Sub
WAHDANIAH
BalasHapus46109051
LATIHAN31A_46109051
Public Class LATIHAN31A_46109051
Dim nia As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=WAHDANIAH")
Dim GO As New DataTable
Public Sub ambildata()
Dim data As New OleDb.OleDbDataAdapter
data = New OleDb.OleDbDataAdapter("SELECT* FROM barang", nia)
GO.Rows.Clear()
data.Fill(GO)
data.Dispose()
End Sub
Private Sub LATIHAN31A_46109051_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
dg46109051.DataSource = GO
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If LATIHAN31B_46109051.Visible = False Then
LATIHAN31B_46109051.Show()
Else
LATIHAN31B_46109051.Activate()
End If
LATIHAN31B_46109051.KB.Text = dg46109051.CurrentRow.Cells("KODEBARANG").Value
LATIHAN31B_46109051.TB146109051.Text = dg46109051.CurrentRow.Cells("KODEBARANG").Value
LATIHAN31B_46109051.TB246109051.Text = dg46109051.CurrentRow.Cells("NAMABARANG").Value
LATIHAN31B_46109051.TB346109051.Text = dg46109051.CurrentRow.Cells("HARGAJUAL").Value
LATIHAN31B_46109051.TB446109051.Text = dg46109051.CurrentRow.Cells("JUMLAHBARANG").Value
End Sub
End Class
LATIHAN31B_46109051
Public Class LATIHAN31B_46109051
Dim nia As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=WAHDANIAH")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TB146109051.Text.Length = 0 Then
MsgBox("Please insert your text")
Exit Sub
End If
If TB246109051.Text.Length = 0 Then
MsgBox("Please insert your text")
Exit Sub
End If
If Val(TB346109051.Text) = 0 Then
MsgBox("Please insert your text")
Exit Sub
End If
If Val(TB446109051.Text) = 0 Then
MsgBox("Please insert your text")
Exit Sub
End If
If KB.Text <> TB146109051.Text Then
Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
PENCARI.AturPencarianDataBase("BARANG","KODEBARANG", TB146109051.Text, 1, nia)
If PENCARI.JumlanBaris > 0 Then
MsgBox("the data has been exist please insert new data")
TB146109051.Text = ""
TB246109051.Text = ""
TB346109051.Text = ""
TB446109051.Text = ""
Exit Sub
End If
End If
Dim Cm As New OleDb.OleDbCommand
Cm = New OleDb.OleDbCommand("update BARANG set KODEBARANG ='" & TB146109051.Text & "', NAMABARANG = '" & TB246109051.Text & "', HARGAJUAL=" & Val(TB346109051.Text) & ", JUMLAHBARANG=" & Val(TB446109051.Text) & " where KODEBARANG='" & KB.Text & "'", nia)
nia.Open()
Cm.ExecuteNonQuery()
nia.Close()
Cm.Dispose()
KB.Text = ""
TB146109051.Text = ""
TB246109051.Text = ""
TB346109051.Text = ""
TB446109051.Text = ""
LATIHAN31A_46109051.ambildata()
Me.Close()
End Sub
End Class
tugasku 27-34
BalasHapushttp://arularva.blogspot.com/2011/11/tugas-27-34-muh-fahrul-46109005_20.html
http://wahyunirachman.blogspot.com/2012/10/latihan31a46110020.html
BalasHapushttp://wahyunirachman.blogspot.com/2012/10/latihan31b46110020.html
http://ildayani.blogspot.com/2012/10/latihan31a46110002.html
BalasHapushttp://ildayani.blogspot.com/2012/10/latihan31b46110002.html
http://diyanahdina.blogspot.com/2012/10/latihan31a46110045.html
BalasHapushttp://diyanahdina.blogspot.com/2012/10/latihan31b46110045.html
http://srikartikafanty.blogspot.com/2012/10/latihan31a46110007_11.html
BalasHapushttp://srikartikafanty.blogspot.com/2012/10/latihan31b46110007.html
http://alfaega.blogspot.com/2012/10/latihan30b46110022.html
BalasHapushttp://alfaega.blogspot.com/2012/10/latihan31b46110022.html
http://hanihasan07.blogspot.com/2012/10/latihan31a46110044.html
BalasHapushttp://hanihasan07.blogspot.com/2012/10/latihan31b46110044.html
http://idhamsyaam.blogspot.com/2012/10/latihan3146110021.html
BalasHapushttp://sulhihusni.blogspot.com/2012/10/latihan31a46110004.html
BalasHapushttp://sulhihusni.blogspot.com/2012/10/latihan31b46110004.html
http://restyaccounting.blogspot.com/2012/10/latihan31a46110027.html
BalasHapushttp://restyaccounting.blogspot.com/2012/10/latihan31b46110027.html
http://amalmaulana92.blogspot.com/2012/10/latihan31a46110003.html
BalasHapushttp://amalmaulana92.blogspot.com/2012/10/latihan31b46110003.html
http://mulyawarman039.blogspot.com/2012/10/latihan31a46110039.html
BalasHapushttp://mulyawarman039.blogspot.com/2012/10/latihan31b46110039.html
http://dianmegariski.blogspot.com/2012/10/latihan31a46110023_13.html
BalasHapushttp://dianmegariski.blogspot.com/2012/10/latihan31b46110023_13.html
http://feibyfrycilia.blogspot.com/2012/10/latihan31a46110055.html
BalasHapushttp://feibyfrycilia.blogspot.com/2012/10/latihan31b46110055.html
http://fitrianihamka.blogspot.com/2012/10/latihan31a46110006.html
BalasHapushttp://fitrianihamka.blogspot.com/2012/10/latihan31b46110006.html
http://muthmil8.blogspot.com/2012/10/latihan31adan31b46110037.html
BalasHapushttp://bothbon.blogspot.com/2012/10/latihan31a46110043.html
BalasHapushttp://bothbon.blogspot.com/2012/10/latihan31b46110043.html
http://bahrizj.blogspot.com/2012/10/latihan31a46110001.html
BalasHapushttp://bahrizj.blogspot.com/2012/10/latihan31b46110001.html
http://aardianzah2.blogspot.com/2012/10/latihan-31a.html
BalasHapushttp://aardianzah2.blogspot.com/2012/10/latihan-31b.html
http://rafidashaleh.blogspot.com/2012/10/latihan31a46110041_1139.html
BalasHapushttp://rafidashaleh.blogspot.com/2012/10/latihan31b46110041.html
http://cacalisa.blogspot.com/2012/10/latihan31a46110038.html
http://cacalisa.blogspot.com/2012/10/latihan31b46110038_5318.html
http://deodns.blogspot.com/2012/10/latihan31a46110040.html
BalasHapushttp://deodns.blogspot.com/2012/10/latihan31b46110040.html
http://yuliaasrida427.blogspot.com/2012/10/latihan31a46110009.html
BalasHapushttp://yuliaasrida427.blogspot.com/2012/10/latihan31b46110009.html
http://masdarwati.blogspot.com/2012/10/latihan31a46110024.html
BalasHapushttp://masdarwati.blogspot.com/2012/10/latihan31b46110024.html