BERIKUT KOMPONEN MINIMAL DALAM DELPHI
Komponen
|
Properti
|
Fungsi
|
Adoconnection1
|
Connection dg ODBC driver
|
Mengatur koneksi dengan database
|
Adoquery1
|
Select*from istilah
|
Mengisikan query
|
Datasetprovider1
|
Connection: adoquery1
|
Sbg provider dari adoquery-dataset
|
Clientdataset 1
|
Provider: datasetprovider1
|
Memberikan perintah SQL dalam aplikasi
|
Datasource1
|
Dataset: clientdataset1
|
Sumber data untuk ditampilkan dalam
dbgrid dll
|
Dbgrid
|
Datasource: datasource1
|
Bentuk tabel yang disajikan
|
Dbmemo1
|
Datasource: datasource1
|
Menampilkan data memo
|
Button1
|
Memberikan perintah
|
SETELAH KOMPONEN DI MUKTAHIRKAN
PELAJARI CODING DALAM DELPHI BERIKUT :
unit Unit5;
interface
uses
Windows, Messages, SysUtils, Variants,
Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DBCtrls, Grids, DBGrids,
DB, DBClient, Provider, ADODB,
jpeg, ExtCtrls;
type
TForm5 = class(TForm)
ADOConnection1: TADOConnection;
DBGrid1: TDBGrid;
Button1: TButton;
ADOQuery1: TADOQuery;
DataSetProvider2: TDataSetProvider;
ClientDataSet2: TClientDataSet;
DataSource2: TDataSource;
DBMemo1: TDBMemo;
Image1: TImage;
Label1: TLabel;
Label3: TLabel;
Button2: TButton;
ADOQuery1NO: TAutoIncField;
ADOQuery1ISTILAH: TWideStringField;
ADOQuery1DEFINISI: TWideMemoField;
ClientDataSet2NO: TAutoIncField;
ClientDataSet2ISTILAH: TWideStringField;
ClientDataSet2DEFINISI: TWideMemoField;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
implementation
{$R *.dfm}
procedure
TForm5.Button1Click(Sender: TObject); (perintah dalam
tombol cari)
var
tanggal:
string;
tombolOk:boolean;
begin
tanggal:='';
tombolOk:=inputquery('ISTILAH','ISTILAH
:',tanggal);
if
(tombolOk) then
begin
adoquery1.Active:=false;
clientdataset2.Active:=false;
adoquery1.SQL.Clear;
adoquery1.SQL.Add(
'select
definisi.[NO],'+
' definisi.[ISTILAH],'+
' definisi.[definisi]'+
'FROM definisi ' ) ;
if (tanggal
<> '') then
begin
adoquery1.SQL.Add(
' WHERE DEFINISI.[ISTILAH] like ''%'+
tanggal+'%''');
end;
adoquery1.Active:=true;
clientdataset2.Active:=true;
end;
end;
procedure
TForm5.Button2Click(Sender: TObject); (perintah dalam tombol about)
begin
showmessage('app
developer : DIDI KURNIADI');
showmessage('kunjungi
kami di www.labkim-ia.blogspot.com');
end;
procedure
TForm5.Button3Click(Sender: TObject); (tombol back)
begin
CLIENTDATASET2.PRIOR;
end;
procedure
TForm5.Button4Click(Sender: TObject); tombol next
begin
CLIENTDATASET2.Next;
end;
procedure TForm5.Button5Click(Sender:
TObject); (tombol
last)
begin
CLIENTDATASET2.Last;
end;
procedure
TForm5.Button6Click(Sender: TObject); (tombol first)
begin
CLIENTDATASET2.First;
end;
end.
SELAMAT MECOBA :)