0% found this document useful (0 votes)
43 views4 pages

Membuat Program Ticketing Menggunakan Delphi 7

This document contains code for a database application with 3 buttons. Button 1 adds new data to the database table. Button 2 edits existing data in the table. Button 3 deletes a selected record from the table after confirming the deletion. The code connects to a database, defines fields and controls on the form, and includes event handler procedures for each button to perform the corresponding database operation.

Uploaded by

Fallen ID
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views4 pages

Membuat Program Ticketing Menggunakan Delphi 7

This document contains code for a database application with 3 buttons. Button 1 adds new data to the database table. Button 2 edits existing data in the table. Button 3 deletes a selected record from the table after confirming the deletion. The code connects to a database, defines fields and controls on the form, and includes event handler procedures for each button to perform the corresponding database operation.

Uploaded by

Fallen ID
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Nama: Falensius Mintu

Kelas : TI.23
Nim : 20192205094
Tugas Data Base

 Button1 (Proses Tambah)

 Button 2 (Proses Edit)


Nama: Falensius Mintu
Kelas : TI.23
Nim : 20192205094
 Button 3 (Proses Hapus)

 SCRIPT :
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB, Grids, DBGrids, ExtCtrls;

type
TForm1 = class(TForm)
Panel1: TPanel;
ADOConnection1: TADOConnection;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
ADOTable1: TADOTable;
Edit1: TEdit;
Edit2: TEdit;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Nama: Falensius Mintu
Kelas : TI.23
Nim : 20192205094
Label3: TLabel;
Label4: TLabel;
Button1: TButton;
Panel2: TPanel;
Button2: TButton;
Button3: TButton;
Label5: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);


var jk:string;
begin
ADOtable1.edit;
ADOtable1.Fields[0].AsString:=edit1.Text;
ADOtable1.Fields[1].AsString:=edit2.Text;
if (radiobutton1.checked=true)then
jk:='Umum'
else jk:='VIP';
ADOtable1.Fields[2].AsString:=jk;
ADOtable1.Fields[3].AsString:=ComboBox1.Text;
ADOtable1.Fields[4].AsString:=ComboBox2.Text;
ADOtable1.Post;
ADOtable1.Close;
ADOtable1.Open

end;

procedure TForm1.Button2Click(Sender: TObject);


var jk:String;
begin
ADOTable1.Edit;
ADOTable1.Fields[0].AsString:=Edit1.Text;
ADOTable1.Fields[1].AsString:=Edit2.Text;
Nama: Falensius Mintu
Kelas : TI.23
Nim : 20192205094
if (RadioButton1.Checked=true) then
jk:='Umum'
else jk:='VIP';
ADOTable1.Fields[2].AsString:=jk;
ADOTable1.Fields[3].AsString:=ComboBox1.Text;
ADOTable1.Fields[4].AsString:=ComboBox2.Text;
ADOTable1.Post;
ADOTable1.Open;
end;

procedure TForm1.Button3Click(Sender: TObject);


begin
if MessageDlg('Hapus
Data:'+ADOTable1.Fields[1].AsString+'?',mtconfirmation,mbOKCancel,0)=mrok then
ADOTable1.Delete;
end;

end.

You might also like