This is Delphi Tutorial about creating and manipulating MS Access database
with KADAo component ( http://www.kadao.dir.bg/ ) ,
and as usual you can find here source code for this app,
and also exe files at address : https://drive.google.com/open?id=0B_njK7HczCjDWkdtbTVseExyYW8
procedure TForm1.Button1Click(Sender: TObject);
begin
SaveDialog1.InitialDir:=ExtractFilePath(Application.ExeName) ;
if SaveDialog1.Execute() then
begin
procedure TForm1.Button3Click(Sender: TObject);
begin
if OpenDialog1.Execute() then
begin
OpenDialog1.InitialDir:=ExtractFilePath(Application.ExeName);
Database1.Close;
Database1.Database:=OpenDialog1.FileName;
Database1.Open;
lbDbName.Caption:=Database1.Database;
ComboBox1.Items.Clear;
ComboBox1.Items.AddStrings(Database1.TableNames);
ComboBox1.ItemIndex:=0;
end;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
if (Database1.Connected=True) and ( ComboBox1.Text<>'') then
begin
Table1.Close;
Table1.TableName:=ComboBox1.Text;
Table1.Open;
This is Delphi Tutorial about client-server application, and as usual you can find here source code for this app, and also exe files at address :
https://drive.google.com/open?id=0B_njK7HczCjDekg0WG1hamUyWTA
Here is video tutorial :
and here is source code :
Source code for client app : unit MainForm;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
LabInt:=LabInt+10;
Label1.Caption:=IntToStr(LabInt);
end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
if ProgressBar1.Position<ProgressBar1.Max then
ProgressBar1.Position:=ProgressBar1.Position+1
else
ProgressBar1.Position:=0;
end;
procedure TForm1.Timer3Timer(Sender: TObject);
begin
case ButtonTag of
101:
if Image1.Left>0 then
Image1.Left:=Image1.Left-IntxL
else Button4.Click;
102:
if Image1.Left<Panel2.Width then
Image1.Left:=Image1.Left+IntxR
else
Button3.Click;
103:
if Image1.Top>0 then
Image1.Top:=Image1.Top-IntxT
else
Button6.Click;
104:
if Image1.Top<Panel2.Height then
Image1.Top:=Image1.Top+IntxB
else
Button5.Click;
end;
end;
procedure TForm1.UpDown1Click(Sender: TObject; Button: TUDBtnType);
begin
if Button=btNext then IntxL:=IntxL+10;
if Button=btPrev then IntxL:=IntxL-10;
Edit1.Text:=IntToStr(IntxL);
end;
procedure TForm1.UpDown2Click(Sender: TObject; Button: TUDBtnType);
begin
if Button=btNext then IntxR:=IntxR+10;
if Button=btPrev then IntxR:=IntxR-10;
Edit2.Text:=IntToStr(IntxR);
end;
procedure TForm1.UpDown3Click(Sender: TObject; Button: TUDBtnType);
begin
if Button=btNext then IntxT:=IntxT+10;
if Button=btPrev then IntxT:=IntxT-10;
Edit3.Text:=IntToStr(IntxT);
end;
procedure TForm1.UpDown4Click(Sender: TObject; Button: TUDBtnType);
begin
if Button=btNext then IntxB:=IntxB+10;
if Button=btPrev then IntxB:=IntxB-10;
Edit4.Text:=IntToStr(IntxB);
end;
procedure TForm1.UpDown5Click(Sender: TObject; Button: TUDBtnType);
begin
if Button=btNext then Timer3.Interval:=Timer3.Interval+10;
if Button=btPrev then Timer3.Interval:=Timer3.Interval-10;
Edit5.Text:=IntToStr(Timer3.Interval);
end;
In this tutorial you can learn how to work with Listview in Delphi.
You can learn how to create,edit and delete items, and also how to add icons to items.
procedure TForm1.Button1Click(Sender: TObject);
var
Itm:TListItem;
begin
Itm:=ListView1.Items.Add;
Itm.Caption:='Item '+IntToStr(ListView1.Items.Count);
Itm.SubItems.Add(Itm.Caption+' Subitem 1');
Itm.SubItems.Add(Itm.Caption+' Subitem 2');
Itm.ImageIndex:=0;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ListView1.DeleteSelected;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
ListView1.Items.Clear;
end;
procedure TForm1.Button4Click(Sender: TObject);
var i:Integer;
begin
for I := 0 to ListView1.Items.Count-1 do
begin
ListView1.Items[i].Checked:=True;
end;
end;
procedure TForm1.Button5Click(Sender: TObject);
var i:Integer;
begin
for I := 0 to ListView1.Items.Count-1 do
begin
ListView1.Items[i].Checked:=False;
end;
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
ListView1.ViewStyle:=vsIcon;
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
ListView1.ViewStyle:=vsList;
end;
procedure TForm1.Button8Click(Sender: TObject);
begin
ListView1.ViewStyle:=vsReport;
end;
procedure TForm1.Button9Click(Sender: TObject);
begin
ListView1.ViewStyle:=vsSmallIcon;
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
ListView1.Checkboxes:=CheckBox1.Checked;
end;
procedure TForm1.CheckBox2Click(Sender: TObject);
begin
ListView1.RowSelect:=CheckBox2.Checked;
end;
procedure TForm1.ListView1DblClick(Sender: TObject);
begin
if ListView1.ItemFocused.Checked=true then
ListView1.ItemFocused.Checked:=false
else
ListView1.ItemFocused.Checked:=True;
end;
procedure TForm1.ListView1Edited(Sender: TObject; Item: TListItem;
var S: string);
begin
Item.SubItems[0]:=
S+' Subitem 1';
Item.SubItems[1]:=
S+' Subitem 2';
end;
In this tutorial you can see some basic Excel cells formatting.
Microsoft excel is a powerful tool for data manipulation.
This is just basic way to do this, it is unbelievable how this can be used in more advanced examples.
I use this in my regular work very often.