Public Class Latihan30a035 Dim Jalan 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 ambil As New DataTable
Public Sub ambildata() 'mendeklarasikan adapter Dim data As New OleDb.OleDbDataAdapter
'Mengatur data yang akan di angkut data = New OleDb.OleDbDataAdapter("SELECT* FROM BARANG", Jalan)
'bersihkan data dulu sebelum isi data lain ambil.Rows.Clear()
'untuk memasukkan data yg telah di angkut ke dalam datatable data.Fill(ambil) data.Dispose()
End Sub
Private Sub Latihan30a035_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() DataGridView1035.DataSource = ambil End Sub
Private Sub Button1035_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1035.Click 'Menampilkan form 30b If Latihan30b035.Visible = False Then Latihan30b035.Show() Else Latihan30b035.Activate() End If
'mengisi textbox yang ada pada 25b Latihan30b035.kb035.Text = DataGridView1035.CurrentRow.Cells("KODEBARANG").Value Latihan30b035.t1035.Text = DataGridView1035.CurrentRow.Cells("KODEBARANG").Value Latihan30b035.t2035.Text = DataGridView1035.CurrentRow.Cells("NAMABARANG").Value Latihan30b035.t3035.Text = DataGridView1035.CurrentRow.Cells("HARGAJUAL").Value Latihan30b035.t4035.Text = DataGridView1035.CurrentRow.Cells("JUMLAHBARANG").Value End Sub End Class
Public Class Latihan30b035 Dim Jalan 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")
Private Sub Button1035_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1035.Click 'perintah periksa data If t1035.Text.Length = 0 Then MsgBox("Plase Insert Your Text") Exit Sub End If
If t2035.Text.Length = 0 Then MsgBox("Plase Insert Your Text") Exit Sub End If
If Val(t3035.Text) = 0 Then MsgBox("Plase Insert Your Text") Exit Sub End If
If Val(t4035.Text) = 0 Then MsgBox("Plase Insert Your Text") Exit Sub End If
'perintah ambil data
If kb035.Text <> t1035.Text Then Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1035.Text, 1, Jalan)
If PENCARI.JumlanBaris > 0 Then MsgBox("The data has been exist please insert new data")
'mengosongkan text box t1035.Text = " " t2035.Text = " " t3035.Text = " " t4035.Text = " " Exit Sub End If End If
'deklarasi object command Dim Cm As New OleDb.OleDbCommand Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t1035.Text & "', NAMABARANG = '" & t2035.Text & "', HARGAJUAL=" & Val(t3035.Text) & ", JUMLAHBARANG=" & Val(t4035.Text) & " where KODEBARANG='" & kb035.Text & "'", Jalan) Jalan.Open() Cm.ExecuteNonQuery() Jalan.Close() Cm.Dispose()
Public Class LATIHAN030A36109033 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb") Dim tiwi As New DataTable Private Sub LATIHAN030A36109033_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(tiwi) DataGridView1.DataSource = tiwi End Sub Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click If LATIHAN030B36109033.Visible = False Then LATIHAN030B36109033.Show() Else LATIHAN030B36109033.Activate() End If End Sub
End Class
Public Class LATIHAN030B36109033
Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN030B36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Val(t136109033.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109033.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109033.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109033.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
Public Class LATIHAN030A36109033 Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir") Dim tiwi As New DataTable Private Sub LATIHAN030A36109033_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(tiwi) DataGridView1.DataSource = tiwi End Sub Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click If LATIHAN030B36109033.Visible = False Then LATIHAN030B36109033.Show() Else LATIHAN030B36109033.Activate() End If End Sub
End Class
Public Class LATIHAN030B36109033
Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN030B36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Val(t136109033.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109033.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109033.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109033.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
Dim Jalan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=nideria")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If t136109050.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109050.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109050.Text) = 0 Then MsgBox("harga barang belum terisi") Exit Sub End If
If Val(t436109050.Text) = 0 Then MsgBox("jumlah barang belum terisi") Exit Sub End If
If kb36109050.Text <> t136109050.Text Then Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t136109050.Text, 1, Jalan)
If PENCARI.JumlanBaris > 0 Then MsgBox("kode sudah ada")
t136109050.Text = " " t236109050.Text = " " t336109050.Text = " " t436109050.Text = " " Exit Sub End If End If
Dim Cm As New OleDb.OleDbCommand Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t136109050.Text & "', NAMABARANG = '" & t236109050.Text & "', HARGAJUAL=" & Val(t336109050.Text) & ", JUMLAHBARANG=" & Val(t436109050.Text) & " where KODEBARANG='" & kb36109050.Text & "'", Jalan) Jalan.Open() Cm.ExecuteNonQuery() Jalan.Close() Cm.Dispose()
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 Val(T136109032.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If T236109032.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(T336109032.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(T436109032.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
Dim Jalan 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 t136109040.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109040.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109040.Text) = 0 Then MsgBox("harga barang belum terisi") Exit Sub End If
If Val(t436109040.Text) = 0 Then MsgBox("jumlah barang belum terisi") Exit Sub End If
If kb36109040.Text <> t136109040.Text Then Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t136109040.Text, 1, Jalan)
If PENCARI.JumlanBaris > 0 Then MsgBox("kode sudah ada")
t136109040.Text = " " t236109040.Text = " " t336109040.Text = " " t436109040.Text = " " Exit Sub End If End If
Dim Cm As New OleDb.OleDbCommand Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t136109040.Text & "', NAMABARANG = '" & t236109040.Text & "', HARGAJUAL=" & Val(t336109040.Text) & ", JUMLAHBARANG=" & Val(t436109040.Text) & " where KODEBARANG='" & kb36109040.Text & "'", Jalan) Jalan.Open() Cm.ExecuteNonQuery() Jalan.Close() Cm.Dispose()
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
Private Sub LATIHAN030A36109032_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim lanjutkan As New OleDb.OleDbDataAdapter 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 LATIHAN030B36109032.Visible = False Then LATIHAN030B36109032.Show() Else LATIHAN030B36109032.Activate() End If
Public Class LATIHAN30A36109040 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 DataTable
Public Sub ambildata() Dim data As New OleDb.OleDbDataAdapter data = New OleDb.OleDbDataAdapter("SELECT* FROM BARANG", conect) cari.Rows.Clear() data.Fill(cari) data.Dispose()
End Sub
Private Sub LATIHAN30A36109040_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() DataGridView1.DataSource = cari End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Form30B36109040.Visible = False Then Form30B36109040.Show() Else Form30B36109040.Activate() End If
Form30B36109040.kb36109040.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value Form30B36109040.t136109040.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value Form30B36109040.t236109040.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value Form30B36109040.t336109040.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value LATIHAN30B36109040.t436109040.Text = DataGridView1.CurrentRow.Cells("JUMLAHBARANG").Value End Sub
Public Class Latih30A_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 Private Sub latihan153619043_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cobaji As New OleDb.OleDbDataAdapter cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect) cobaji.Fill(nhunoe) DataGridView1.DataSource = nhunoe End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Latih30B_36109034.Visible = False Then Latih30B_36109034.Show() Else Latih30B_36109034.Activate() End If End Sub End Class
Public Class latih30B_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 Val(t1.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If If t2.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If If Val(t3.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If If Val(t4.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If cari.AturPencarianDataBase("BARANG", "KODEBARANG", kb.Text, 1, conect) If cari.JumlanBaris = False Then MsgBox("kode tidak ada") Exit Sub 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 ='" & kb.Text & "'", conect) conect.Open() com.ExecuteNonQuery() conect.Close() com.Dispose() kb.Text = "" t1.Text = "" t2.Text = "" t3.Text = "" t4.Text = "" End Sub End Class
Public Class LATIHAN_030A_36109056 Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=2422") Dim hasbiya As New DataTable
Private Sub LATIHAN030A012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cobaji As New OleDb.OleDbDataAdapter cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect) cobaji.Fill(hasbiya) DataGridView1.DataSource = hasbiya End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If LATIHAN_030B_36109056.Visible = False Then LATIHAN_030B_36109056.Show() Else LATIHAN_030B_36109056.Activate() End If
End Sub End Class
Public Class LATIHAN_030B_36109056 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 Val(t1_36109056.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If If t2_36109056.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If If Val(t3_36109056.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If If Val(t4_36109056.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If cari.AturPencarianDataBase("BARANG", "KODEBARANG", kb_36109056.Text, 1, conect) If cari.JumlanBaris = False Then MsgBox("kode tidak ada") Exit Sub 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 ='" & kb_36109056.Text & "'", conect) conect.Open() com.ExecuteNonQuery() conect.Close() com.Dispose()
Dim Connect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=25") Dim Ijal As New DataTable Private Sub Lat30A36109042_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim tryon As New OleDb.OleDbDataAdapter tryon = New OleDb.OleDbDataAdapter("select * from barang", Connect) tryon.Fill(Ijal) DGV136109042.DataSource = Ijal End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109042.Click If Lat30B36109042.Visible = False Then Lat30B36109042.Show() Else Lat30B36109042.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") Dim cari As New ByIskandar.CariKeDataBaseByIskandar* Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109042.Click
If Val(t136109042.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If If t236109042.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109042.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109042.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
Public Class LATIHAN30A36109044 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
Private Sub LATIHAN30A36109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim coba As New OleDb.OleDbDataAdapter coba = New OleDb.OleDbDataAdapter("select * from barang", conect) coba.Fill(firah) DataGridView1.DataSource = firah
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If LATIHAN30B36109044.Visible = False Then LATIHAN30B36109044.Show() Else LATIHAN30B36109044.Activate() End If
Public Class LATIHAN30B36109044 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 Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Val(t136109044.Text) = 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 barang belum diisi") Exit Sub End If
Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=sanie") Dim sanie As New DataTable Private Sub latihan153619030_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim mencoba As New OleDb.OleDbDataAdapter mencoba = New OleDb.OleDbDataAdapter("select * from barang", conect) mencoba.Fill(sanie) DataGridView1.DataSource = sanie End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If LATIHAN030B36109030.Visible = False Then LATIHAN030B36109030.Show() Else LATIHAN030B36109030.Activate() 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=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 Val(t1.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t2.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t3.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t4.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
Public Class Latihan30a035
BalasHapusDim Jalan 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 ambil As New DataTable
Public Sub ambildata()
'mendeklarasikan adapter
Dim data As New OleDb.OleDbDataAdapter
'Mengatur data yang akan di angkut
data = New OleDb.OleDbDataAdapter("SELECT* FROM BARANG", Jalan)
'bersihkan data dulu sebelum isi data lain
ambil.Rows.Clear()
'untuk memasukkan data yg telah di angkut ke dalam datatable
data.Fill(ambil)
data.Dispose()
End Sub
Private Sub Latihan30a035_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
DataGridView1035.DataSource = ambil
End Sub
Private Sub Button1035_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1035.Click
'Menampilkan form 30b
If Latihan30b035.Visible = False Then
Latihan30b035.Show()
Else
Latihan30b035.Activate()
End If
'mengisi textbox yang ada pada 25b
Latihan30b035.kb035.Text = DataGridView1035.CurrentRow.Cells("KODEBARANG").Value
Latihan30b035.t1035.Text = DataGridView1035.CurrentRow.Cells("KODEBARANG").Value
Latihan30b035.t2035.Text = DataGridView1035.CurrentRow.Cells("NAMABARANG").Value
Latihan30b035.t3035.Text = DataGridView1035.CurrentRow.Cells("HARGAJUAL").Value
Latihan30b035.t4035.Text = DataGridView1035.CurrentRow.Cells("JUMLAHBARANG").Value
End Sub
End Class
Public Class Latihan30b035
BalasHapusDim Jalan 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")
Private Sub Button1035_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1035.Click
'perintah periksa data
If t1035.Text.Length = 0 Then
MsgBox("Plase Insert Your Text")
Exit Sub
End If
If t2035.Text.Length = 0 Then
MsgBox("Plase Insert Your Text")
Exit Sub
End If
If Val(t3035.Text) = 0 Then
MsgBox("Plase Insert Your Text")
Exit Sub
End If
If Val(t4035.Text) = 0 Then
MsgBox("Plase Insert Your Text")
Exit Sub
End If
'perintah ambil data
If kb035.Text <> t1035.Text Then
Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1035.Text, 1, Jalan)
If PENCARI.JumlanBaris > 0 Then
MsgBox("The data has been exist please insert new data")
'mengosongkan text box
t1035.Text = " "
t2035.Text = " "
t3035.Text = " "
t4035.Text = " "
Exit Sub
End If
End If
'deklarasi object command
Dim Cm As New OleDb.OleDbCommand
Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t1035.Text & "', NAMABARANG = '" & t2035.Text & "', HARGAJUAL=" & Val(t3035.Text) & ", JUMLAHBARANG=" & Val(t4035.Text) & " where KODEBARANG='" & kb035.Text & "'", Jalan)
Jalan.Open()
Cm.ExecuteNonQuery()
Jalan.Close()
Cm.Dispose()
'mengosongkan text box
kb035.Text = " "
t1035.Text = " "
t2035.Text = " "
t3035.Text = " "
t4035.Text = " "
'mengambildata
Latihan30a035.ambildata()
'menutup form
Me.Close()
End Sub
End Class
Public Class LATIHAN030A36109033
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
Dim tiwi As New DataTable
Private Sub LATIHAN030A36109033_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(tiwi)
DataGridView1.DataSource = tiwi
End Sub
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click
If LATIHAN030B36109033.Visible = False Then
LATIHAN030B36109033.Show()
Else
LATIHAN030B36109033.Activate()
End If
End Sub
End Class
Public Class LATIHAN030B36109033
Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN030B36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Val(t136109033.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109033.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109033.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109033.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
cari.AturPencarianDataBase("BARANG", "KODEBARANG", kb36109033.Text, 1, CONECT)
If cari.JumlanBaris = False Then
MsgBox("kode tidak ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t136109033.Text & "', namabarang = '" & t236109033.Text & "', hargajual = " & Val(t336109033.Text) & ", jumlahbarang = " & Val(t436109033.Text) & " where kodebarang ='" & kb36109033.Text & "'", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
kb36109033.Text = ""
t136109033.Text = ""
t236109033.Text = ""
t336109033.Text = ""
t436109033.Text = ""
End Sub
End Class
revisi :)
BalasHapusPublic Class LATIHAN030A36109033
Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir")
Dim tiwi As New DataTable
Private Sub LATIHAN030A36109033_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(tiwi)
DataGridView1.DataSource = tiwi
End Sub
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click
If LATIHAN030B36109033.Visible = False Then
LATIHAN030B36109033.Show()
Else
LATIHAN030B36109033.Activate()
End If
End Sub
End Class
Public Class LATIHAN030B36109033
Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub LATIHAN030B36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Val(t136109033.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109033.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109033.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109033.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
cari.AturPencarianDataBase("BARANG", "KODEBARANG", kb36109033.Text, 1, CONECT)
If cari.JumlanBaris = False Then
MsgBox("kode tidak ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t136109033.Text & "', namabarang = '" & t236109033.Text & "', hargajual = " & Val(t336109033.Text) & ", jumlahbarang = " & Val(t436109033.Text) & " where kodebarang ='" & kb36109033.Text & "'", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
kb36109033.Text = ""
t136109033.Text = ""
t236109033.Text = ""
t336109033.Text = ""
t436109033.Text = ""
End Sub
End Class
Public Class Form30B36109050
BalasHapusDim Jalan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=nideria")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If t136109050.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109050.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109050.Text) = 0 Then
MsgBox("harga barang belum terisi")
Exit Sub
End If
If Val(t436109050.Text) = 0 Then
MsgBox("jumlah barang belum terisi")
Exit Sub
End If
If kb36109050.Text <> t136109050.Text Then
Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t136109050.Text, 1, Jalan)
If PENCARI.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
t136109050.Text = " "
t236109050.Text = " "
t336109050.Text = " "
t436109050.Text = " "
Exit Sub
End If
End If
Dim Cm As New OleDb.OleDbCommand
Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t136109050.Text & "', NAMABARANG = '" & t236109050.Text & "', HARGAJUAL=" & Val(t336109050.Text) & ", JUMLAHBARANG=" & Val(t436109050.Text) & " where KODEBARANG='" & kb36109050.Text & "'", Jalan)
Jalan.Open()
Cm.ExecuteNonQuery()
Jalan.Close()
Cm.Dispose()
kb36109050.Text = " "
t136109050.Text = " "
t236109050.Text = " "
t336109050.Text = " "
t436109050.Text = " "
Form30A36109050.ambildata()
Me.Close()
End Sub
End Class
Public Class LATIHAN030B36109032
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 Val(T136109032.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If T236109032.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(T336109032.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(T436109032.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
misal.AturPencarianDataBase("BARANG", "KODEBARANG", KB36109032.Text, 1, sambung)
If misal.JumlanBaris = False Then
MsgBox("kode tidak ada")
Exit Sub
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(T436109032.Text) & " where kodebarang ='" & KB36109032.Text & "'", sambung)
sambung.Open()
com.ExecuteNonQuery()
sambung.Close()
com.Dispose()
KB36109032.Text = ""
T136109032.Text = ""
T236109032.Text = ""
T336109032.Text = ""
T436109032.Text = ""
End Sub
End Class
Public Class LATIHAN30B36109040
BalasHapusDim Jalan 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 t136109040.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109040.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109040.Text) = 0 Then
MsgBox("harga barang belum terisi")
Exit Sub
End If
If Val(t436109040.Text) = 0 Then
MsgBox("jumlah barang belum terisi")
Exit Sub
End If
If kb36109040.Text <> t136109040.Text Then
Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t136109040.Text, 1, Jalan)
If PENCARI.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
t136109040.Text = " "
t236109040.Text = " "
t336109040.Text = " "
t436109040.Text = " "
Exit Sub
End If
End If
Dim Cm As New OleDb.OleDbCommand
Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t136109040.Text & "', NAMABARANG = '" & t236109040.Text & "', HARGAJUAL=" & Val(t336109040.Text) & ", JUMLAHBARANG=" & Val(t436109040.Text) & " where KODEBARANG='" & kb36109040.Text & "'", Jalan)
Jalan.Open()
Cm.ExecuteNonQuery()
Jalan.Close()
Cm.Dispose()
kb36109040.Text = " "
t136109040.Text = " "
t236109040.Text = " "
t336109040.Text = " "
t436109040.Text = " "
LATIHAN30A36109040.ambildata()
Me.Close()
End Sub
End Class
Public Class LATIHAN030A36109032
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
Private Sub LATIHAN030A36109032_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim lanjutkan As New OleDb.OleDbDataAdapter
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 LATIHAN030B36109032.Visible = False Then
LATIHAN030B36109032.Show()
Else
LATIHAN030B36109032.Activate()
End If
End Sub
End Class
Public Class LATIHAN30A36109040
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 DataTable
Public Sub ambildata()
Dim data As New OleDb.OleDbDataAdapter
data = New OleDb.OleDbDataAdapter("SELECT* FROM BARANG", conect)
cari.Rows.Clear()
data.Fill(cari)
data.Dispose()
End Sub
Private Sub LATIHAN30A36109040_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
DataGridView1.DataSource = cari
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Form30B36109040.Visible = False Then
Form30B36109040.Show()
Else
Form30B36109040.Activate()
End If
Form30B36109040.kb36109040.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
Form30B36109040.t136109040.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
Form30B36109040.t236109040.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value
Form30B36109040.t336109040.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value
LATIHAN30B36109040.t436109040.Text = DataGridView1.CurrentRow.Cells("JUMLAHBARANG").Value
End Sub
End Class
Public Class Latih30A_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
Private Sub latihan153619043_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cobaji As New OleDb.OleDbDataAdapter
cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect)
cobaji.Fill(nhunoe)
DataGridView1.DataSource = nhunoe
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Latih30B_36109034.Visible = False Then
Latih30B_36109034.Show()
Else
Latih30B_36109034.Activate()
End If
End Sub
End Class
Public Class latih30B_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 Val(t1.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t2.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t3.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t4.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
cari.AturPencarianDataBase("BARANG", "KODEBARANG", kb.Text, 1, conect)
If cari.JumlanBaris = False Then
MsgBox("kode tidak ada")
Exit Sub
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 ='" & kb.Text & "'", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
kb.Text = ""
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End Sub
End Class
Public Class LATIHAN_030A_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 hasbiya As New DataTable
Private Sub LATIHAN030A012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cobaji As New OleDb.OleDbDataAdapter
cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect)
cobaji.Fill(hasbiya)
DataGridView1.DataSource = hasbiya
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If LATIHAN_030B_36109056.Visible = False Then
LATIHAN_030B_36109056.Show()
Else
LATIHAN_030B_36109056.Activate()
End If
End Sub
End Class
Public Class LATIHAN_030B_36109056
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 Val(t1_36109056.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t2_36109056.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t3_36109056.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t4_36109056.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
cari.AturPencarianDataBase("BARANG", "KODEBARANG", kb_36109056.Text, 1, conect)
If cari.JumlanBaris = False Then
MsgBox("kode tidak ada")
Exit Sub
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 ='" & kb_36109056.Text & "'", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
kb_36109056.Text = ""
t1_36109056.Text = ""
t2_36109056.Text = ""
t3_36109056.Text = ""
t4_36109056.Text = ""
End Sub
End Class
Public Class Lat30A36109042
BalasHapusDim Connect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=25")
Dim Ijal As New DataTable
Private Sub Lat30A36109042_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim tryon As New OleDb.OleDbDataAdapter
tryon = New OleDb.OleDbDataAdapter("select * from barang", Connect)
tryon.Fill(Ijal)
DGV136109042.DataSource = Ijal
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109042.Click
If Lat30B36109042.Visible = False Then
Lat30B36109042.Show()
Else
Lat30B36109042.Activate()
End If
End Sub
End Class
Public Class Lat30B36109042
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar*
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109042.Click
If Val(t136109042.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109042.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109042.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109042.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
cari.AturPencarianDataBase("BARANG", "KODEBARANG", kb136109042.Text, 1, conect)
If cari.JumlanBaris = False Then
MsgBox("kode tidak ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t136109042.Text & "', namabarang = '" & t236109042.Text & "', hargajual = " & Val(t336109042.Text) & ", jumlahbarang = " & Val(t436109042.Text) & " where kodebarang ='" & kb136109042.Text & "'", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
kb136109042.Text = ""
t136109042.Text = ""
t236109042.Text = ""
t336109042.Text = ""
t436109042.Text = ""
End Sub
End Class
Public Class LATIHAN30A36109044
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
Private Sub LATIHAN30A36109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim coba As New OleDb.OleDbDataAdapter
coba = New OleDb.OleDbDataAdapter("select * from barang", conect)
coba.Fill(firah)
DataGridView1.DataSource = firah
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If LATIHAN30B36109044.Visible = False Then
LATIHAN30B36109044.Show()
Else
LATIHAN30B36109044.Activate()
End If
End Sub
End Class
Public Class LATIHAN30B36109044
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 Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(t136109044.Text) = 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 barang belum diisi")
Exit Sub
End If
firah.AturPencarianDataBase("BARANG", "KODEBARANG", kb36109044.Text, 1, conect)
If firah.JumlanBaris = False Then
MsgBox("kode tidak ada")
Exit Sub
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 ='" & kb36109044.Text & "'", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
kb36109044.Text = ""
t136109044.Text = ""
t236109044.Text = ""
t336109044.Text = ""
t436109044.Text = ""
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=sanie")
BalasHapusDim sanie As New DataTable
Private Sub latihan153619030_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim mencoba As New OleDb.OleDbDataAdapter
mencoba = New OleDb.OleDbDataAdapter("select * from barang", conect)
mencoba.Fill(sanie)
DataGridView1.DataSource = sanie
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If LATIHAN030B36109030.Visible = False Then
LATIHAN030B36109030.Show()
Else
LATIHAN030B36109030.Activate()
End If
End Sub
End Class
Public Class LATIHAN030B36109030
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 Val(t1.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t2.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t3.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t4.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
cari.AturPencarianDataBase("BARANG", "KODEBARANG", kb.Text, 1, conect)
If cari.JumlanBaris = False Then
MsgBox("kode tidak ada")
Exit Sub
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 ='" & kb.Text & "'", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
kb.Text = ""
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End Sub
End Class
http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian.html
BalasHapushttp://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan30a36110048.html
http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian-latihan30b36110048.html
http://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan30b36110048.html
http://www.masnurselayar.blogspot.com/2012/10/latihan-30a36110055.html
BalasHapushttp://www.masnurselayar.blogspot.com/2012/10/latihan-30b36110055.html
http://nurrahmahrasyid2.blogspot.com/2012/10/latihan30a36110042.html
BalasHapushttp://nurrahmahrasyid2.blogspot.com/2012/10/latihan30b36110042.html
http://nurhanalott.blogspot.com/2012/10/latihan30a36110029.html
BalasHapushttp://nurhanalott.blogspot.com/2012/10/latihan30b36110029.html
http://ias-anakbola.blogspot.com/2012/10/latihan30a36110056.html
BalasHapushttp://ias-anakbola.blogspot.com/2012/10/latihan30b36110056.html
http://ilhaazzahra.blogspot.com/2012/10/latihan30a36110033.html
BalasHapushttp://ilhaazzahra.blogspot.com/2012/10/latihan30b36110033.html
http://rizka-azisah.blogspot.com/2012/10/deskripsi-penyelesaian_4501.html
BalasHapushttp://rizka-azisah.blogspot.com/2012/10/deskripsi-penyelesaian_6538.html
http://andiniwarakusuma.blogspot.com/2012/10/latihan30a36110034.html
BalasHapushttp://andiniwarakusuma.blogspot.com/2012/10/latihan30b36110034.html
http://rahmisuryatama05.blogspot.com/2012/10/latihan30a36110040.html
BalasHapushttp://rahmisuryatama05.blogspot.com/2012/10/latihan30b36110040.html
http://audryasharii.blogspot.com/2012/10/latihan30a36110031.html
BalasHapushttp://audryasharii.blogspot.com/2012/10/latihan30b36110031.html
http://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur_5426.html
BalasHapushttp://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur_388.html
http://rosyanausman.blogspot.com/2012/10/latihan30a36110036.html
BalasHapushttp://rosyanausman.blogspot.com/2012/10/latihan30b36110036.html
http://rainaagrippinaa.blogspot.com/2012/10/latihan30a36110032.html
BalasHapushttp://rainaagrippinaa.blogspot.com/2012/10/latihan30b36110032.html
http://sriayu-36110030.blogspot.com/2012/10/diskripsi-prosedur-latihan-30-a.html
BalasHapushttp://sriayu-36110030.blogspot.com/2012/10/diskripsi-prosedur-latihan-30-b.html
http://tiya-sri.blogspot.com/2012/10/latihan30a36110044-aplikasi-komputer-4.html
BalasHapushttp://tiya-sri.blogspot.com/2012/10/latihan30b36110044-aplikasi-komputer-4.html
http://dewiwahyuni91.blogspot.com/2012/10/latihan30a36110038.html
BalasHapushttp://dewiwahyuni91.blogspot.com/2012/10/latihan30b36110038_11.html
http://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan30a36110037.html
BalasHapushttp://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan30b36110037.html
http://03melisa.blogspot.com/2012/10/latihan-30a-36110051-apkom-4-d3b.html
BalasHapushttp://03melisa.blogspot.com/2012/10/latihan-30b-36110051-apkom-4-d3b.html
http://burhankhang58.blogspot.com/2012/10/latihan30a36110047.html
BalasHapushttp://burhankhang58.blogspot.com/2012/10/latihan30b36110047.html
http://hasfiahzain.blogspot.com/2012/10/latihan30a36110052.html
BalasHapushttp://hasfiahzain.blogspot.com/2012/10/latihan30b36110052.html
http://zulkiflitryputra.blogspot.com/2012/10/latihan30a36110046.html
BalasHapushttp://zulkiflitryputra.blogspot.com/2012/10/latihan30b36110046.html
http://sukadriady.blogspot.com/2012/10/latihan30a36110043.html
BalasHapushttp://sukadriady.blogspot.com/2012/10/latihan30b36110043.html
http://ruslancullank1.blogspot.com/2012/10/deskripsilatihan30a36110054.html
BalasHapushttp://ruslancullank1.blogspot.com/2012/10/deskripsilatihan30b36110054.html