Tugas program database oracle 3 (Obby Uman Galih)

1.Laundy

laundry

Public kon As New ADODB.Connection
Public rs1 As New ADODB.Recordset

Private Sub cb1_Click()
Form2.Show
Unload Me
End Sub

Private Sub CBB_Click()
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
End Sub

Private Sub Command1_Click()
If Text1 = “” Or Text2 = “” Or Text3 = “” Or Text4 = “” Then
MsgBox “Data Belum Lengkap…!”, vbInformation, “Info”
Else
Dim SQL As String
SQL = “insert into tb1 (nama_konsumen,banyaknya,harga_perkilo, tanggal_ambil) values (‘” _
& Text1 & “‘,'” & Text2 & “‘,'” & Text3 & “‘,'” & Text4 & “‘)”
kon.Execute SQL
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
MsgBox “Data berhasil ditambah”, vbInformation, “Info”
End If

End Sub
Private Sub Command2_Click()
Dim hps As String
hps = “delete from tb1 where nama_konsumen = ‘” & Text1 & “‘”
kon.Execute hps
MsgBox “Data Berhasil di Hapus”, vbInformation, “Info”
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Form_Activate
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Command4_Click()
Form_Activate
rs1.Open “select * from tb1 where Nama_konsumen = ‘” & Text1 & “‘”, kon
If Not rs1.EOF Then
Text2 = rs1!Banyaknya
Text3 = rs1!harga_perkilo
Text4 = rs1!tanggal_ambil

MsgBox “Data Ada, Berhasil di Tampilkan”, vbInformation, “Info”
Else
MsgBox “Data yang anda cari tidak ada”, vbInformation, “Ada Info”
End If
End Sub

Private Sub Command5_Click()
End
End Sub

Private Sub Form_Activate()
Set kon = New ADODB.Connection
Set rs1 = New ADODB.Recordset
kon.Open “provider=Microsoft.jet.oledb.4.0;data source=” & App.Path & “\Database5.mdb”
End Sub

2.Daftar Harga Motor

dealer

Public kon As New ADODB.Connection
Public rs1 As New ADODB.Recordset

Private Sub cb1_Click()
Form2.Show
Unload Me
End Sub

Private Sub CBB_Click()
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
End Sub

Private Sub Command1_Click()
If Text1 = “” Or Text2 = “” Or Text3 = “” Or Text4 = “” Then
MsgBox “Data Belum Lengkap…!”, vbInformation, “Info”
Else
Dim SQLTambah As String
SQLTambah = “insert into tb1 (Kode,Tipe,harga, persediaan) values (‘” _
& Text1 & “‘,'” & Text2 & “‘,'” & Text3 & “‘,'” & Text4 & “‘)”
kon.Execute SQLTambah
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
MsgBox “Data berhasil ditambah”, vbInformation, “Info”
End If

End Sub
Private Sub Command2_Click()
Dim hps As String
hps = “delete from tb1 where kode = ‘” & Text1 & “‘”
kon.Execute hps
MsgBox “Data Berhasil di Hapus”, vbInformation, “Info”
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Form_Activate
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Command4_Click()
Form_Activate
rs1.Open “select * from tb1 where kode = ‘” & Text1 & “‘”, kon
If Not rs1.EOF Then
Text2 = rs1!tipe
Text3 = rs1!harga
Text4 = rs1!persediaan

MsgBox “Data Ada, Berhasil di Tampilkan”, vbInformation, “Info”
Else
MsgBox “Data yang anda cari tidak ada”, vbInformation, “Ada Info”
End If
End Sub

Private Sub Command5_Click()
End
End Sub

Private Sub Form_Activate()
Set kon = New ADODB.Connection
Set rs1 = New ADODB.Recordset
kon.Open “provider=Microsoft.jet.oledb.4.0;data source=” & App.Path & “\Database2.mdb”
End Sub

3.Data Mahasiswa

mahasiswa

Public kon As New ADODB.Connection
Public rs1 As New ADODB.Recordset

Private Sub cb1_Click()
Form2.Show
Unload Me
End Sub

Private Sub CBB_Click()
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
End Sub

Private Sub Command1_Click()
If Text1 = “” Or Text2 = “” Or Text3 = “” Or Text4 = “” Then
MsgBox “Data Belum Lengkap…!”, vbInformation, “Info”
Else
Dim SQLTambah As String
SQLTambah = “insert into tb1 (NPM,Nama,Alamat, Jurusan) values (‘” _
& Text1 & “‘,'” & Text2 & “‘,'” & Text3 & “‘,'” & Text4 & “‘)”
kon.Execute SQLTambah
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
MsgBox “Data berhasil ditambah”, vbInformation, “Info”
End If

End Sub
Private Sub Command2_Click()
Dim hps As String
hps = “delete from tb1 where NPM = ‘” & Text1 & “‘”
kon.Execute hps
MsgBox “Data Berhasil di Hapus”, vbInformation, “Info”
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Form_Activate
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Command4_Click()
Form_Activate
rs1.Open “select * from tb1 where NPM = ‘” & Text1 & “‘”, kon
If Not rs1.EOF Then
Text2 = rs1!Nama
Text3 = rs1!Alamat
Text4 = rs1!Jurusan

MsgBox “Data Ada, Berhasil di Tampilkan”, vbInformation, “Informasi”
Else
MsgBox “Data yang anda cari tidak ada”, vbInformation, “Ada Informasi!!!!!”
End If
End Sub

Private Sub Command5_Click()
End
End Sub

Private Sub Form_Activate()
Set kon = New ADODB.Connection
Set rs1 = New ADODB.Recordset
kon.Open “provider=Microsoft.jet.oledb.4.0;data source=” & App.Path & “\Database.mdb”
End Sub

4.Pendaftaran Siswa Baru

sisbar

Public kon As New ADODB.Connection
Public rs1 As New ADODB.Recordset

Private Sub cb1_Click()
Form2.Show
Unload Me
End Sub

Private Sub CBB_Click()
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
End Sub

Private Sub Command1_Click()
If Text1 = “” Or Text2 = “” Or Text3 = “” Or Text4 = “” Then
MsgBox “Data Belum Lengkap…!”, vbInformation, “Info”
Else
Dim SQLTambah As String
SQLTambah = “insert into tb1 (No_pendaftaran,Nama,Alamat, Asal_Sekolah) values (‘” _
& Text1 & “‘,'” & Text2 & “‘,'” & Text3 & “‘,'” & Text4 & “‘)”
kon.Execute SQLTambah
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
MsgBox “Data berhasil ditambah”, vbInformation, “Info”
End If

End Sub
Private Sub Command2_Click()
Dim hps As String
hps = “delete from tb1 where No_pendaftaran = ‘” & Text1 & “‘”
kon.Execute hps
MsgBox “Data Berhasil di Hapus”, vbInformation, “Info”
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Form_Activate
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Command4_Click()
Form_Activate
rs1.Open “select * from tb1 where No_pendaftaran = ‘” & Text1 & “‘”, kon
If Not rs1.EOF Then
Text2 = rs1!Nama
Text3 = rs1!Alamat
Text4 = rs1!Asal_sekolah

MsgBox “Data Ada, Berhasil di Tampilkan”, vbInformation, “Info”
Else
MsgBox “Data yang anda cari tidak ada”, vbInformation, “Ada Info”
End If
End Sub

Private Sub Command5_Click()
End
End Sub

Private Sub Form_Activate()
Set kon = New ADODB.Connection
Set rs1 = New ADODB.Recordset
kon.Open “provider=Microsoft.jet.oledb.4.0;data source=” & App.Path & “\Database3.mdb”
End Sub

5.Price list Hand Phone

hp

Public kon As New ADODB.Connection
Public rs1 As New ADODB.Recordset

Private Sub cb1_Click()
Form2.Show
Unload Me
End Sub

Private Sub CBB_Click()
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
End Sub

Private Sub Command1_Click()
If Text1 = “” Or Text2 = “” Or Text3 = “” Or Text4 = “” Then
MsgBox “Data Belum Lengkap…!”, vbInformation, “Info”
Else
Dim SQLTambah As String
SQLTambah = “insert into tb1 (kode,merek,tipe, harga) values (‘” _
& Text1 & “‘,'” & Text2 & “‘,'” & Text3 & “‘,'” & Text4 & “‘)”
kon.Execute SQLTambah
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
MsgBox “Data berhasil ditambah”, vbInformation, “Info”
End If

End Sub
Private Sub Command2_Click()
Dim hps As String
hps = “delete from tb1 where kode = ‘” & Text1 & “‘”
kon.Execute hps
MsgBox “Data Berhasil di Hapus”, vbInformation, “Info”
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Form_Activate
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Command4_Click()
Form_Activate
rs1.Open “select * from tb1 where kode = ‘” & Text1 & “‘”, kon
If Not rs1.EOF Then
Text2 = rs1!merek
Text3 = rs1!tipe
Text4 = rs1!harga

MsgBox “Data Ada, Berhasil di Tampilkan”, vbInformation, “Info”
Else
MsgBox “Data yang anda cari tidak ada”, vbInformation, “Ada Info”
End If
End Sub

Private Sub Command5_Click()
End
End Sub

Private Sub Form_Activate()
Set kon = New ADODB.Connection
Set rs1 = New ADODB.Recordset
kon.Open “provider=Microsoft.jet.oledb.4.0;data source=” & App.Path & “\Database4.mdb”
End Sub

Iklan

Penulis: obbystmikpringsewu.wordpress.com

berdoa dan berusaha

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s