Public Class LATIHAN033B_46109010 Dim rossi As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=46") Dim pencarian As New ByIskandar.CariKeDataBaseByIskandar
Private Sub simpan46109010_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles simpan46109010.Click
If t146109010.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t246109010.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t346109010.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t446109010.Text) = 0 Then MsgBox("jumlah barang belum diiisi") Exit Sub End If
Dim risky As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=kiki") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If QQ1_46109050.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If QQ2_46109050.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(QQ3_46109050.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(QQ4_46109050.Text) = 0 Then MsgBox("jumlah barang") Exit Sub End If
Public Class LATIHAN033B_46109006 Dim SRY As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=46") Dim pencarian As New ByIskandar.CariKeDataBaseByIskandar
Private Sub simpan46109006_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles simpan46109006.Click
If t146109006.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t246109006.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t346109006.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t446109006.Text) = 0 Then MsgBox("jumlah barang belum diiisi") Exit Sub End If
Andi Muh. Yusri Public Class Latihan33B_46109038 Dim pencari As New ByIskandar.CariKeDataBaseByIskandar Dim com As New OleDb.OleDbCommand Dim yusri As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;jet OleDb:database password=300591")
Private Sub Simpan_46109038_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan_46109038.Click If KodeLama_46109038.Text = "" Then pencari.AturPencarianDataBase("Barang", "KodeBarang", Kobar_46109038.Text, 1, yusri) If pencari.JumlanBaris > 0 Then MsgBox("kode barang telah ada") Kobar_46109038.Text = "" Exit Sub ElseIf Kobar_46109038.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf Nambar_46109038.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf Harju_46109038.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf Jumbar_46109038.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If Dim siraj As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & Kobar_46109038.Text & "','" & Nambar_46109038.Text & "'," & Val(Harju_46109038.Text) & "," & Val(Jumbar_46109038.Text) & ")" com = New OleDb.OleDbCommand(siraj, yusri) yusri.Open() com.ExecuteNonQuery() yusri.Close() com.Dispose() Kobar_46109038.Text = "" Nambar_46109038.Text = "" Harju_46109038.Text = "" Jumbar_46109038.Text = "" Else If KodeLama_46109038.Text <> Kobar_46109038.Text Then pencari.AturPencarianDataBase("Barang", "KodeBarang", Kobar_46109038.Text, 1, yusri) If pencari.JumlanBaris > 0 Then MsgBox("kode barang tidak dapat diupdate") Exit Sub End If End If End If
If Kobar_46109038.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf Nambar_46109038.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf Harju_46109038.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf Jumbar_46109038.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If Dim mirza As String = "update barang set kodebarang = '" & Kobar_46109038.Text & "', namabarang = '" & Nambar_46109038.Text & "', hargajual = " & Val(Harju_46109038.Text) & ", jumlahbarang = " & Val(Jumbar_46109038.Text) & " where kodebarang = '" & KodeLama_46109038.Text & "'" com = New OleDb.OleDbCommand(mirza, yusri) yusri.Open() com.ExecuteNonQuery() yusri.Close() com.Dispose() KodeLama_46109038.Text = "-" Kobar_46109038.Text = "" Nambar_46109038.Text = "" Harju_46109038.Text = "" Jumbar_46109038.Text = ""
Public Class Latihan033B_46109015 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=015") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button136109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1_46109015.Click If t1_46109015.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t2_46109015.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t3_46109015.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t4_46109015.Text) = 0 Then MsgBox("jumlah barang") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t1_46109015.Text & "','" & t2_46109015.Text & "'," & Val(t3_46109015.Text) & "," & Val(t4_46109015.Text) & ")", conect)
Dim itha As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:database password=979264") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TB146109047.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If TB246109047.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(TB346109047.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(TB446109047.Text) = 0 Then MsgBox("jumlah barang") Exit Sub End If
Public Class Latihan33_B_46109044 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=46109044") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If tb146109044.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If tb246109044.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(tb346109044.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(tb446109044.Text) = 0 Then MsgBox("jumlah barang") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & tb146109044.Text & "','" & tb246109044.Text & "'," & Val(tb346109044.Text) & "," & Val(tb446109044.Text) & ")", conect)
Public Class LATIHAN33A46109026 Dim ibe As New DataTable Dim ibhe As New OleDb.OleDbCommand Dim tinggal As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=26")
Private Sub LATIHAN33A46109026_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", tinggal) ibe.Rows.Clear() adapter.Fill(ibe) adapter.Dispose() dtg46109026.DataSource = ibe End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If LATIHAN33B46109026.Visible = False Then LATIHAN33B46109026.Show() Else LATIHAN33B46109026.Activate() End If End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If LATIHAN33B46109026.Visible = False Then LATIHAN33B46109026.Show() Else LATIHAN33B46109026.Activate() End If LATIHAN33B46109026.KB.Text = dtg46109026.CurrentRow.Cells("kodebarang").Value LATIHAN33B46109026.kb46109026.Text = dtg46109026.CurrentRow.Cells("kodebarang").Value LATIHAN33B46109026.nb46109026.Text = dtg46109026.CurrentRow.Cells("namabarang").Value LATIHAN33B46109026.hj46109026.Text = dtg46109026.CurrentRow.Cells("jumlahbarang").Value LATIHAN33B46109026.jb46109026.Text = dtg46109026.CurrentRow.Cells("hargajual").Value End Sub End Class
Public Class LATIHAN33B46109026 Dim pencari As New ByIskandar.CariKeDataBaseByIskandar Dim ibe As New OleDb.OleDbCommand Dim xx As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=26")
Private Sub LATIHAN33B46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If KB.Text = "" Then pencari.AturPencarianDataBase("Barang", "KodeBarang", kb46109026.Text, 1, xx) If pencari.JumlanBaris > 0 Then MsgBox("kode barang telah ada") kb46109026.Text = "" Exit Sub ElseIf kb46109026.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf nb46109026.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf hj46109026.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf jb46109026.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If Dim ibhe As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kb46109026.Text & "','" & nb46109026.Text & "'," & Val(hj46109026.Text) & "," & Val(jb46109026.Text) & ")" ibe = New OleDb.OleDbCommand(ibhe, xx) xx.Open() ibe.ExecuteNonQuery() xx.Close() ibe.Dispose() kb46109026.Text = "" nb46109026.Text = "" hj46109026.Text = "" jb46109026.Text = "" Else If KB.Text <> kb46109026.Text Then pencari.AturPencarianDataBase("Barang", "KodeBarang", kb46109026.Text, 1, xx) If pencari.JumlanBaris > 0 Then MsgBox("kode barang tidak dapat diupdate") Exit Sub End If End If If kb46109026.Text.Length = 0 Then MsgBox("kode barang harus tercantum") Exit Sub ElseIf nb46109026.Text.Length = 0 Then MsgBox("nama barang harus tercantum") Exit Sub ElseIf hj46109026.Text.Length = 0 Then MsgBox("harga jual harus tercantum") Exit Sub ElseIf jb46109026.Text.Length = 0 Then MsgBox("jumlah barang harus tercantum") Exit Sub End If Dim ibnu As String = "update barang set kodebarang = '" & kb46109026.Text & "', namabarang = '" & nb46109026.Text & "', hargajual = " & Val(hj46109026.Text) & ", jumlahbarang = " & Val(jb46109026.Text) & " where kodebarang = '" & KB.Text & "'" ibe = New OleDb.OleDbCommand(ibnu, xx) xx.Open() ibe.ExecuteNonQuery() xx.Close() ibe.Dispose() KB.Text = "-" kb46109026.Text = "" nb46109026.Text = "" hj46109026.Text = "" jb46109026.Text = "" End If
Public Class Form33B Dim vero As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=allah swt") Dim nika As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If vd1_052.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If vd2_052.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(vd3_052.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(vd4_052.Text) = 0 Then MsgBox("jumlah barang belum diiisi") Exit Sub End If
Dim vesa As New OleDb.OleDbCommand vesa = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & vd1_052.Text & "','" & vd2_052.Text & "'," & Val(vd3_052.Text) & "," & Val(vd4_052.Text) & ")", vero)
Public Class latihan_33A_46109044 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=1234") Dim cari As New DataTable Public Sub lirhas() Dim syahril As New OleDb.OleDbDataAdapter syahril = New OleDb.OleDbDataAdapter("select * from barang", conect) cari.Rows.Clear() syahril.Fill(cari) syahril.Dispose() End Sub Private Sub latihan033A_46109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load lirhas() data46109044.DataSource = cari End Sub
Private Sub E46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles E46109044.Click If latihan_33B_46109044.Visible = False Then latihan_33B_46109044.Show() Else latihan_33B_46109044.Activate() End If End Sub
Private Sub T46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T46109044.Click If latihan_33B_46109044.Visible = False Then latihan_33B_46109044.Show() Else latihan_33B_46109044.Activate() End If latihan_33B_46109044.kode146109044.Text = data46109044.CurrentRow.Cells("KODEBARANG").Value latihan_33B_46109044.kode46109044.Text = data46109044.CurrentRow.Cells("KODEBARANG").Value latihan_33B_46109044.nama46109044.Text = data46109044.CurrentRow.Cells("NAMABARANG").Value latihan_33B_46109044.harga46109044.Text = data46109044.CurrentRow.Cells("HARGAJUAL").Value latihan_33B_46109044.jumlah46109044.Text = data46109044.CurrentRow.Cells("JUMLAHBARANG").Value End Sub
Private Sub H46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles H46109044.Click Dim syahril As New OleDb.OleDbCommand syahril = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & data46109044.CurrentRow.Cells("KODEBARANG").Value & "'", conect) conect.Open() syahril.ExecuteNonQuery() conect.Close() syahril.Dispose() lirhas() End Sub End Class
Public Class latihan_33B_46109044 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=1234") Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub S46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109044.Click If kode46109044.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If nama46109044.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(harga46109044.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(jumlah46109044.Text) = 0 Then MsgBox("jumlah barang") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & kode46109044.Text & "','" & nama46109044.Text & "'," & Val(harga46109044.Text) & "," & Val(jumlah46109044.Text) & ")", conect)
FARADILLAH AMALIA RIVAI
BalasHapusLATIHAN 33 B
Public Class LATIHAN033B_46109010
Dim rossi As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=46")
Dim pencarian As New ByIskandar.CariKeDataBaseByIskandar
Private Sub simpan46109010_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles simpan46109010.Click
If t146109010.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t246109010.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t346109010.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t446109010.Text) = 0 Then
MsgBox("jumlah barang belum diiisi")
Exit Sub
End If
pencarian.AturPencarianDataBase("barang", "kodebarang", t146109010.Text, 1, rossi)
If pencarian.JumlanBaris > 0 Then
MsgBox("data sudah ada")
Exit Sub
End If
Dim vr As New OleDb.OleDbCommand
vr = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t146109010.Text & "','" & t246109010.Text & "'," & Val(t346109010.Text) & "," & Val(t446109010.Text) & ")", rossi)
rossi.Open()
vr.ExecuteNonQuery()
rossi.Close()
vr.Dispose()
t146109010.Text = ""
t246109010.Text = ""
t346109010.Text = ""
t446109010.Text = ""
End Sub
End Class
Public Class Latihan33B_46109050
BalasHapusDim risky As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=kiki")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If QQ1_46109050.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If QQ2_46109050.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(QQ3_46109050.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(QQ4_46109050.Text) = 0 Then
MsgBox("jumlah barang")
Exit Sub
End If
cari.AturPencarianDataBase("barang", "kodebarang", QQ1_46109050.Text, 1, risky)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim mahira As New OleDb.OleDbCommand
mahira = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & QQ1_46109050.Text & "','" & QQ2_46109050.Text & "'," & Val(QQ3_46109050.Text) & "," & Val(QQ4_46109050.Text) & ")", risky)
risky.Open()
mahira.ExecuteNonQuery()
risky.Close()
mahira.Dispose()
QQ1_46109050.Text = ""
QQ2_46109050.Text = ""
QQ3_46109050.Text = ""
QQ4_46109050.Text = ""
Latihan33A_46109050.zaza()
End Sub
End Class
Komentar ini telah dihapus oleh pengarang.
BalasHapusPublic Class LATIHAN033B_46109006
BalasHapusDim SRY As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=46")
Dim pencarian As New ByIskandar.CariKeDataBaseByIskandar
Private Sub simpan46109006_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles simpan46109006.Click
If t146109006.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t246109006.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t346109006.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t446109006.Text) = 0 Then
MsgBox("jumlah barang belum diiisi")
Exit Sub
End If
pencarian.AturPencarianDataBase("barang", "kodebarang", t146109006.Text, 1, SRY)
If pencarian.JumlanBaris > 0 Then
MsgBox("data sudah ada")
Exit Sub
End If
Dim KI2 As New OleDb.OleDbCommand
KI2 = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t146109006.Text & "','" & t246109006.Text & "'," & Val(t346109006.Text) & "," & Val(t446109006.Text) & ")", SRY)
SRY.Open()
KI2.ExecuteNonQuery()
SRY.Close()
KI2.Dispose()
t146109006.Text = ""
t246109006.Text = ""
t346109006.Text = ""
t446109006.Text = ""
End Sub
End Class
Andi Muh. Yusri
BalasHapusPublic Class Latihan33B_46109038
Dim pencari As New ByIskandar.CariKeDataBaseByIskandar
Dim com As New OleDb.OleDbCommand
Dim yusri As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;jet OleDb:database password=300591")
Private Sub Simpan_46109038_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan_46109038.Click
If KodeLama_46109038.Text = "" Then
pencari.AturPencarianDataBase("Barang", "KodeBarang", Kobar_46109038.Text, 1, yusri)
If pencari.JumlanBaris > 0 Then
MsgBox("kode barang telah ada")
Kobar_46109038.Text = ""
Exit Sub
ElseIf Kobar_46109038.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf Nambar_46109038.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf Harju_46109038.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf Jumbar_46109038.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
Dim siraj As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & Kobar_46109038.Text & "','" & Nambar_46109038.Text & "'," & Val(Harju_46109038.Text) & "," & Val(Jumbar_46109038.Text) & ")"
com = New OleDb.OleDbCommand(siraj, yusri)
yusri.Open()
com.ExecuteNonQuery()
yusri.Close()
com.Dispose()
Kobar_46109038.Text = ""
Nambar_46109038.Text = ""
Harju_46109038.Text = ""
Jumbar_46109038.Text = ""
Else
If KodeLama_46109038.Text <> Kobar_46109038.Text Then
pencari.AturPencarianDataBase("Barang", "KodeBarang", Kobar_46109038.Text, 1, yusri)
If pencari.JumlanBaris > 0 Then
MsgBox("kode barang tidak dapat diupdate")
Exit Sub
End If
End If
End If
If Kobar_46109038.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf Nambar_46109038.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf Harju_46109038.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf Jumbar_46109038.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
Dim mirza As String = "update barang set kodebarang = '" & Kobar_46109038.Text & "', namabarang = '" & Nambar_46109038.Text & "', hargajual = " & Val(Harju_46109038.Text) & ", jumlahbarang = " & Val(Jumbar_46109038.Text) & " where kodebarang = '" & KodeLama_46109038.Text & "'"
com = New OleDb.OleDbCommand(mirza, yusri)
yusri.Open()
com.ExecuteNonQuery()
yusri.Close()
com.Dispose()
KodeLama_46109038.Text = "-"
Kobar_46109038.Text = ""
Nambar_46109038.Text = ""
Harju_46109038.Text = ""
Jumbar_46109038.Text = ""
End Sub
End Class
Public Class Latihan033B_46109015
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=015")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button136109038_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1_46109015.Click
If t1_46109015.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t2_46109015.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t3_46109015.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t4_46109015.Text) = 0 Then
MsgBox("jumlah barang")
Exit Sub
End If
cari.AturPencarianDataBase("barang", "kodebarang", t1_46109015.Text, 1, conect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & t1_46109015.Text & "','" & t2_46109015.Text & "'," & Val(t3_46109015.Text) & "," & Val(t4_46109015.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t1_46109015.Text = ""
t2_46109015.Text = ""
t3_46109015.Text = ""
t4_46109015.Text = ""
Latihan033A_46109015.imah()
End Sub
End Class
Public Class Latihan33B46109047
BalasHapusDim itha As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:database password=979264")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TB146109047.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If TB246109047.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(TB346109047.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(TB446109047.Text) = 0 Then
MsgBox("jumlah barang")
Exit Sub
End If
cari.AturPencarianDataBase("barang", "kodebarang", TB146109047.Text, 1, itha)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim muhitha As New OleDb.OleDbCommand
muhitha = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & TB146109047.Text & "','" & TB246109047.Text & "'," & Val(TB346109047.Text) & "," & Val(TB446109047.Text) & ")", itha)
itha.Open()
muhitha.ExecuteNonQuery()
itha.Close()
muhitha.Dispose()
TB146109047.Text = ""
TB246109047.Text = ""
TB346109047.Text = ""
TB446109047.Text = ""
Latihan33A46109047.saya()
End Sub
End Class
Public Class Latihan33_B_46109044
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=46109044")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If tb146109044.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If tb246109044.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(tb346109044.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(tb446109044.Text) = 0 Then
MsgBox("jumlah barang")
Exit Sub
End If
cari.AturPencarianDataBase("barang", "kodebarang", tb146109044.Text, 1, conect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & tb146109044.Text & "','" & tb246109044.Text & "'," & Val(tb346109044.Text) & "," & Val(tb446109044.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
tb146109044.Text = ""
tb246109044.Text = ""
tb346109044.Text = ""
tb446109044.Text = ""
Latihan33_A_46109044.ambildata()
End Sub
End Class
Public Class LATIHAN33A46109026
BalasHapusDim ibe As New DataTable
Dim ibhe As New OleDb.OleDbCommand
Dim tinggal As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=26")
Private Sub LATIHAN33A46109026_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", tinggal)
ibe.Rows.Clear()
adapter.Fill(ibe)
adapter.Dispose()
dtg46109026.DataSource = ibe
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If LATIHAN33B46109026.Visible = False Then
LATIHAN33B46109026.Show()
Else
LATIHAN33B46109026.Activate()
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If LATIHAN33B46109026.Visible = False Then
LATIHAN33B46109026.Show()
Else
LATIHAN33B46109026.Activate()
End If
LATIHAN33B46109026.KB.Text = dtg46109026.CurrentRow.Cells("kodebarang").Value
LATIHAN33B46109026.kb46109026.Text = dtg46109026.CurrentRow.Cells("kodebarang").Value
LATIHAN33B46109026.nb46109026.Text = dtg46109026.CurrentRow.Cells("namabarang").Value
LATIHAN33B46109026.hj46109026.Text = dtg46109026.CurrentRow.Cells("jumlahbarang").Value
LATIHAN33B46109026.jb46109026.Text = dtg46109026.CurrentRow.Cells("hargajual").Value
End Sub
End Class
Public Class LATIHAN33B46109026
BalasHapusDim pencari As New ByIskandar.CariKeDataBaseByIskandar
Dim ibe As New OleDb.OleDbCommand
Dim xx As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & Application.StartupPath & "\DATABARANG.accdb;jet OLEDB:database password=26")
Private Sub LATIHAN33B46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If KB.Text = "" Then
pencari.AturPencarianDataBase("Barang", "KodeBarang", kb46109026.Text, 1, xx)
If pencari.JumlanBaris > 0 Then
MsgBox("kode barang telah ada")
kb46109026.Text = ""
Exit Sub
ElseIf kb46109026.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf nb46109026.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf hj46109026.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf jb46109026.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
Dim ibhe As String = "insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & kb46109026.Text & "','" & nb46109026.Text & "'," & Val(hj46109026.Text) & "," & Val(jb46109026.Text) & ")"
ibe = New OleDb.OleDbCommand(ibhe, xx)
xx.Open()
ibe.ExecuteNonQuery()
xx.Close()
ibe.Dispose()
kb46109026.Text = ""
nb46109026.Text = ""
hj46109026.Text = ""
jb46109026.Text = ""
Else
If KB.Text <> kb46109026.Text Then
pencari.AturPencarianDataBase("Barang", "KodeBarang", kb46109026.Text, 1, xx)
If pencari.JumlanBaris > 0 Then
MsgBox("kode barang tidak dapat diupdate")
Exit Sub
End If
End If
If kb46109026.Text.Length = 0 Then
MsgBox("kode barang harus tercantum")
Exit Sub
ElseIf nb46109026.Text.Length = 0 Then
MsgBox("nama barang harus tercantum")
Exit Sub
ElseIf hj46109026.Text.Length = 0 Then
MsgBox("harga jual harus tercantum")
Exit Sub
ElseIf jb46109026.Text.Length = 0 Then
MsgBox("jumlah barang harus tercantum")
Exit Sub
End If
Dim ibnu As String = "update barang set kodebarang = '" & kb46109026.Text & "', namabarang = '" & nb46109026.Text & "', hargajual = " & Val(hj46109026.Text) & ", jumlahbarang = " & Val(jb46109026.Text) & " where kodebarang = '" & KB.Text & "'"
ibe = New OleDb.OleDbCommand(ibnu, xx)
xx.Open()
ibe.ExecuteNonQuery()
xx.Close()
ibe.Dispose()
KB.Text = "-"
kb46109026.Text = ""
nb46109026.Text = ""
hj46109026.Text = ""
jb46109026.Text = ""
End If
End Sub
End Class
Public Class Form33B
BalasHapusDim vero As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=allah swt")
Dim nika As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If vd1_052.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If vd2_052.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(vd3_052.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(vd4_052.Text) = 0 Then
MsgBox("jumlah barang belum diiisi")
Exit Sub
End If
nika.AturPencarianDataBase("barang", "kodebarang", vd1_052.Text, 1, vero)
If nika.JumlanBaris > 0 Then
MsgBox("data sudah ada")
Exit Sub
End If
Dim vesa As New OleDb.OleDbCommand
vesa = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & vd1_052.Text & "','" & vd2_052.Text & "'," & Val(vd3_052.Text) & "," & Val(vd4_052.Text) & ")", vero)
vero.Open()
vesa.ExecuteNonQuery()
vero.Close()
vesa.Dispose()
vd1_052.Text = ""
vd2_052.Text = ""
vd3_052.Text = ""
vd4_052.Text = ""
End Sub
End Class
http://kumpulanlatihan46109060.blogspot.com/2011/11/latihan-33.html
BalasHapushttp://taufiqgooners.blogspot.com/2011/11/latihan-33-apkom.html
BalasHapushttp://irvanbravely.blogspot.com/2011/11/latihan-33-apkom.html
BalasHapusPublic Class latihan_33A_46109044
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=1234")
Dim cari As New DataTable
Public Sub lirhas()
Dim syahril As New OleDb.OleDbDataAdapter
syahril = New OleDb.OleDbDataAdapter("select * from barang", conect)
cari.Rows.Clear()
syahril.Fill(cari)
syahril.Dispose()
End Sub
Private Sub latihan033A_46109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lirhas()
data46109044.DataSource = cari
End Sub
Private Sub E46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles E46109044.Click
If latihan_33B_46109044.Visible = False Then
latihan_33B_46109044.Show()
Else
latihan_33B_46109044.Activate()
End If
End Sub
Private Sub T46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T46109044.Click
If latihan_33B_46109044.Visible = False Then
latihan_33B_46109044.Show()
Else
latihan_33B_46109044.Activate()
End If
latihan_33B_46109044.kode146109044.Text = data46109044.CurrentRow.Cells("KODEBARANG").Value
latihan_33B_46109044.kode46109044.Text = data46109044.CurrentRow.Cells("KODEBARANG").Value
latihan_33B_46109044.nama46109044.Text = data46109044.CurrentRow.Cells("NAMABARANG").Value
latihan_33B_46109044.harga46109044.Text = data46109044.CurrentRow.Cells("HARGAJUAL").Value
latihan_33B_46109044.jumlah46109044.Text = data46109044.CurrentRow.Cells("JUMLAHBARANG").Value
End Sub
Private Sub H46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles H46109044.Click
Dim syahril As New OleDb.OleDbCommand
syahril = New OleDb.OleDbCommand("DELETE * FROM BARANG WHERE KODEBARANG='" & data46109044.CurrentRow.Cells("KODEBARANG").Value & "'", conect)
conect.Open()
syahril.ExecuteNonQuery()
conect.Close()
syahril.Dispose()
lirhas()
End Sub
End Class
Public Class latihan_33B_46109044
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=1234")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub S46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109044.Click
If kode46109044.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If nama46109044.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(harga46109044.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(jumlah46109044.Text) = 0 Then
MsgBox("jumlah barang")
Exit Sub
End If
cari.AturPencarianDataBase("barang", "kodebarang", kode46109044.Text, 1, conect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into barang(kodebarang,namabarang,hargajual,jumlahbarang) Values('" & kode46109044.Text & "','" & nama46109044.Text & "'," & Val(harga46109044.Text) & "," & Val(jumlah46109044.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
kode46109044.Text = ""
nama46109044.Text = ""
harga46109044.Text = ""
jumlah46109044.Text = ""
latihan_33A_46109044.lirhas()
End Sub
Private Sub latihan_33B_46109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class