B. KONEK KE DATA BASE Klik start - control panel - large icon ODBC dBASE File- add mySQL ODBC 3.51 Driver Finis
2
C. FORM-FORM YANG ADA
1. Form Menu
2. Form Pemesanan Tiket
3
3. Form Laporan Keseluruhan Pemesanan Tiket
D. HASIL LAPORAN CRYSTAL REPORT
Design
Preview
4
E. KETERANGAN DARI FORM-FORM YANG ADA 1. Modul Public con As New ADODB.Connection Public constr As String Public rs As New ADODB.Recordset Public status
Public Sub connect() con.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=penerbangan" con.Open End Sub 2. Form Pemesanan Tiket a. Script Load Adodc Private Sub Form_Load() If con.State = adStateClosed Then connect End If Adodc1.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=penerbangan" End Sub b. Script Kosong Private Sub kosong() Text1.Text = " " Text2.Text = " " Combo1.Text = " " Text3.Text = " " Text4.Text = " " Text5.Text = " " DTPicker = " " End Sub c. Script Combo Private Sub Combo1_click() If Combo1.Text = "GA1265" Then Text2.Text = "GARUDA INDONESIA" Text3.Text = "MEDAN" Text4.Text = "450000" Text5.Text = "3" Else If Combo1.Text = "JT3642" Then Text2.Text = "LION AIR" Text3.Text = "JAKARTA"
5
Text4.Text = "660000" Text5.Text = "3" Else If Combo1.Text = "SJ1266" Then Text2.Text = "SRIWIJAYA AIR" Text3.Text = "JAKARTA" Text4.Text = "600000" Text5.Text = "4" Else If Combo1.Text = "QG4522" Then Text2.Text = "CITYLINE" Text3.Text = "BATAM" Text4.Text = "500000" Text5.Text = "5" Else End If End If End If End If End Sub
d. Script Simpan Private Sub Command1_Click() con.Execute (" insert into penerbangan values('" & Text1 & "','" & Combo1 & "', '" & Text2 & "', '" & Text3 & "', '" & Text4 & "', '" & Text5 & "','" & Format(DTPicker1, "yyyy-mm-dd") & "')") kosong MsgBox ("DATA SUDAH TERSIMPAN") Text1.SetFocus End Sub
6
e. Script Update Private Sub Command2_Click() con.Execute (" update penerbangan set kd_pswt='" & Combo1 & "', nm_pswt='" & Text2 & "', tujuan='" & Text3 & "', harga='" & Text4 & "', jumlah='" & Text5 & "', tgl_pesan='" & Format(DTPicker1, "yyyy-mm-dd") & "'where kd_pesan='" & Trim(Text1.Text) & "' ") kosong MsgBox ("Data berhasil di update") Text1.SetFocus End Sub
7
f. Script Hapus Private Sub Command3_Click() Dim X As String X = MsgBox(" Ingin hapus data ini?[Y/N]", vbYesNo + vbQuestion) If X = vbYes Then con.Execute (" delete from penerbangan where kd_pesan='" & Trim(Text1) & "'") End If kosong Text1.SetFocus End Sub
g. Script Cancel Private Sub Command4_Click() kosong End Sub
8
h. Script Exit Private Sub Command5_Click() X = MsgBox("Apakah Anda Yakin Menutup Program Ini ?", _ vbYesNo + vbQuestion, "Konfirmasi") If X = vbYes Then Unload Me End If End Sub
3. Form Laporan Keseluruhan Pemesanan Tiket a. Script Form Load Private Sub Form_Load() If con.State = adStateClosed Then connect End If End Sub b. Script Preview Private Sub Command1_Click() Dim pass As String, b As String pass = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=penerbangan" Cr.connect = pass Cr.ReportFileName = App.Path & "\report1.rpt" Cr.WindowState = crptMaximized
9
Cr.Formulas(0) = "kepala='" & Text1.Text & "'" Cr.RetrieveDataFiles Cr.Action = 1 End Sub
Hasil Preview
10
c. Script Cancel Private Sub kosong() Text1.Text = " " End Sub d. Script Exit Private Sub Command3_Click() Unload Me End Sub
4. Form Menu Utama a. Script Form Input Data Private Sub idpt_Click() Form1.Show End Sub
b. Script Form Laporan Private Sub lkpt_Click() Form2.Show End Sub
11
c. Script Form Exit Private Sub E_Click() X = MsgBox("apakah anda yakin menutup program ini?", _ vbYesNo + vbQuestion, "konfirmasi") If X = vbYes Then Unload Me End If End Sub