linkedin facebook linkedin facebook nod32

Delphi da ma`lumotlar omborini export qilish

Muallif: Mengliyev Sh.

Qo`shilgan sana: 2016-09-18

Delphi da ma`lumotlar omborini export qilish

 

Forma1 strukturasi quyida berilgan

Kodi quyida keltirilgan

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, Grids, DBGrids, ADODB, ExtCtrls, Menus, XPMan, StdCtrls,
frxpngimage, jpeg, DBCtrls, ExtDlgs, ComCtrls, FreeButton, Buttons, ComObj,
OleServer, WordXP,Clipbrd,shellapi;

type
TForm1 = class(TForm)
img2: TImage;
img3: TImage;
con1: TADOConnection;
qry1: TADOQuery;
ds1: TDataSource;
img5: TImage;
img6: TImage;
img8: TImage;
img7: TImage;
img9: TImage;
img12: TImage;
img13: TImage;
img4: TImage;
img11: TImage;
img14: TImage;
lbl2: TLabel;
grp1: TGroupBox;
dbtxtFamiliya: TDBText;
dbtxtFamiliya1: TDBText;
dbtxtBajarilganish: TDBText;
dbtxtKurs: TDBText;
lbl14: TLabel;
dbtxtSana: TDBText;
lbl15: TLabel;
lbl16: TLabel;
lbl20: TLabel;
lbl21: TLabel;
lbl3: TLabel;
pnl1: TPanel;
Memo1: TDBGrid;
bvl1: TBevel;
bvl2: TBevel;
bvl3: TBevel;
bvl4: TBevel;
img1: TImage;
pm1: TPopupMenu;
mniQoshish1: TMenuItem;
mniOzgartirish1: TMenuItem;
mniOchirish1: TMenuItem;
lbledt2: TLabeledEdit;
lbledt3: TLabeledEdit;
lbledt4: TLabeledEdit;
grp2: TGroupBox;
edt2: TEdit;
btn20: TButton;
btn21: TButton;
btn22: TButton;
Button1: TButton;
btn12: TButton;
btn23: TButton;
btn24: TButton;
btn25: TButton;
btn30: TButton;
btn31: TButton;
btn32: TButton;
btn33: TButton;
btn34: TButton;
btn35: TButton;
btn36: TButton;
btn37: TButton;
btn38: TButton;
btn39: TButton;
ComboBox2: TComboBox;
ds2: TDataSource;
con2: TADOConnection;
qry2: TADOQuery;
con3: TADOConnection;
qry3: TADOQuery;
ds3: TDataSource;
xpmnfst1: TXPManifest;
con4: TADOConnection;
qry4: TADOQuery;
ds4: TDataSource;
pnl2: TPanel;
DBText5: TDBText;
Image1: TImage;
Image10: TImage;
img10: TImage;
lbledt1: TLabeledEdit;
bvl7: TBevel;
lbledt5: TLabeledEdit;
procedure img1Click(Sender: TObject);
procedure img2Click(Sender: TObject);
procedure img3Click(Sender: TObject);
procedure XISOBOT1Click(Sender: TObject);
procedure PDF1Click(Sender: TObject);
procedure WORD1Click(Sender: TObject);
procedure EXCELL1Click(Sender: TObject);
procedure CHOPETISH1Click(Sender: TObject);
procedure CHIQISH1Click(Sender: TObject);
procedure HML1Click(Sender: TObject);
procedure img4Click(Sender: TObject);
procedure FormCanResize(Sender: TObject; var NewWidth,
NewHeight: Integer; var Resize: Boolean);
procedure img5Click(Sender: TObject);
procedure img7Click(Sender: TObject);
procedure img6Click(Sender: TObject);
procedure Belgilash1Click(Sender: TObject);
procedure img9Click(Sender: TObject);
procedure img10Click(Sender: TObject);
procedure img13Click(Sender: TObject);
procedure img12Click(Sender: TObject);
procedure img8Click(Sender: TObject);
procedure img11Click(Sender: TObject);
procedure img14Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure QoshishCtrlD1Click(Sender: TObject);
procedure OzgatirishCtrlI1Click(Sender: TObject);
procedure OchirishCtrlU1Click(Sender: TObject);
procedure mniQoshish1Click(Sender: TObject);
procedure mniOzgartirish1Click(Sender: TObject);
procedure mniOchirish1Click(Sender: TObject);
procedure lbledt1Change(Sender: TObject);
procedure lbledt3Change(Sender: TObject);
procedure lbledt2Change(Sender: TObject);
procedure lbledt4Change(Sender: TObject);
procedure btn10Click(Sender: TObject);
procedure btn13Click(Sender: TObject);
procedure btn17Click(Sender: TObject);
procedure btn18Click(Sender: TObject);
procedure edt1KeyPress(Sender: TObject; var Key: Char);
procedure ComboBox2Select(Sender: TObject);
procedure Memo1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
procedure qry1AfterOpen(DataSet: TDataSet);
procedure btn1Click(Sender: TObject);
procedure img10MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure img10MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure dtp1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
a,b,c:Real;
d:char;

implementation

uses Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9,Math, ConvUtils, TypInfo,DateUtils ,
Unit10, Unit11;

{$R *.dfm}

procedure TForm1.img1Click(Sender: TObject);
begin
form2.show;
qry1.Insert;
end;

procedure TForm1.img2Click(Sender: TObject);
begin
Form9.Show;
end;

procedure TForm1.img3Click(Sender: TObject);
begin
if MessageDlg('Вы действительно хотите удалить?',mtConfirmation, [mbYes,MbNo], 0)=MrYes then
qry1.Delete;
end;

procedure TForm1.XISOBOT1Click(Sender: TObject);
begin
Form3.show;
Form3.frxrprt1.ShowReport;
end;

procedure TForm1.PDF1Click(Sender: TObject);
begin
Form3.frxrprt1.Export(form3.frxpdfxprt1);
end;

procedure TForm1.WORD1Click(Sender: TObject);
begin
Form3.frxrprt1.Export(form3.frxrtfxprt1);
end;

procedure TForm1.EXCELL1Click(Sender: TObject);
begin
Form3.frxrprt1.Export(form3.frxlsxprt1);
end;

procedure TForm1.CHOPETISH1Click(Sender: TObject);
begin
Form3.frxrprt1.ShowReport;
Form3.frxrprt1.print;
end;

procedure TForm1.CHIQISH1Click(Sender: TObject);
begin
close;
end;

procedure TForm1.HML1Click(Sender: TObject);
begin
Form3.frxrprt1.Export(form3.frxhtmlxprt1);
end;

procedure TForm1.img4Click(Sender: TObject);
begin
Form5.Show;

end;

procedure TForm1.FormCanResize(Sender: TObject; var NewWidth,
NewHeight: Integer; var Resize: Boolean);
begin
if (NewWidth<1000)or(NewHeight<=1000) then Resize:=False else
begin
Memo1.Height:=Form1.Height-150;
Memo1.Width:=Form1.Width-20;

end;
end;

 

procedure TForm1.img5Click(Sender: TObject);
begin
Close;
end;

procedure TForm1.img7Click(Sender: TObject);
var
worddoc: OLEVariant;
name:string;
i,countfile:integer;
begin
try
Worddoc := CreateOleObject('Word.Application');
except
ShowMessage('Не удалось запустить MS Word');
Exit;
end;
Worddoc.Visible := True;
Worddoc.Documents.Add;

if Worddoc.ActiveWindow.View.SplitSpecial <> 0 then Worddoc.ActiveWindow.Panes[2].Close;
if (Worddoc.ActiveWindow.ActivePane.View.type = 1) or
(Worddoc.ActiveWindow.ActivePane.View.type = 2) or
(Worddoc.ActiveWindow.ActivePane.View.type = 5) then Worddoc.ActiveWindow.ActivePane.View.type := 3;
Worddoc.ActiveDocument.PageSetup.LineNumbering.Active := False;
//Worddoc.ActiveDocument.PageSetup.Orientation := wdOrientLandscape;
Worddoc.ActiveDocument.PageSetup.TopMargin := (30);
Worddoc.ActiveDocument.PageSetup.BottomMargin := (30);
Worddoc.ActiveDocument.PageSetup.LeftMargin := (30);
Worddoc.ActiveDocument.PageSetup.RightMargin := (30);

 

Worddoc.ActiveWindow.ActivePane.View.SeekView := 0;
Worddoc.Selection.ParagraphFormat.Alignment := 1;
Worddoc.Selection.Font.Size := 12;
Worddoc.Selection.TypeText(Text :='AXBOROT RESURS MARKAZI');
Worddoc.Selection.TypeParagraph;
name:=Worddoc.ActiveDocument.Shapes.AddLine(30,43,560,43).Name;

{##############TABLEAGA################}
Worddoc.Selection.TypeParagraph;
Worddoc.Selection.ParagraphFormat.Alignment := wdAlignParagraphCenter;

 

Form1.qry1.Close;
Form1.qry1.SQL.Clear;
Form1.qry1.SQL.Add('select * from Talaba');
Form1.qry1.Open;
Form1.qry1.Active:=true;

countfile:=Form1.qry1.RecordCount;

Worddoc.Selection.ParagraphFormat.Alignment := 0;
Worddoc.ActiveDocument.Tables.Add (Range:=Worddoc.selection.Range, NumRows :=countfile, NumColumns :=6);
Worddoc.ActiveDocument.Tables.Item(1).Columns.Width:=130;
Worddoc.ActiveDocument.Tables.Item(1).Rows.Height:=15;

Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(1).Width:=33;
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(2).Width:=120;
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(3).Width:=120;
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(4).Width:=50;
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(5).Width:=100;
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(6).Width:=70;

Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(1).Cells.Item(1).Range.Text:='ID ';
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(2).Cells.Item(1).Range.Text:='Familiya ';
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(3).Cells.Item(1).Range.Text:='Fakultet ';
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(4).Cells.Item(1).Range.Text:='Kurs ';
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(5).Cells.Item(1).Range.Text:='Bajarilgan ish ';
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(6).Cells.Item(1).Range.Text:='Sana ';
Form1.qry1.First;
for i:=2 to countfile do
begin
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(1).Cells.Item(i).Range.Text:=Form1.qry1.FieldByName('ID').Value;
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(2).Cells.Item(i).Range.Text:=Form1.qry1.FieldByName('Familiya').Value;
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(3).Cells.Item(i).Range.Text:=Form1.qry1.FieldByName('Fakultet').Value;
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(4).Cells.Item(i).Range.Text:=Form1.qry1.FieldByName('Kurs').Value;
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(5).Cells.Item(i).Range.Text:=Form1.qry1.FieldByName('Bajarilgan ish').Value;
Worddoc.ActiveDocument.Tables.Item(1).Columns.Item(6).Cells.Item(i).Range.Text:=Form1.qry1.FieldByName('Sana').Value;
Form1.qry1.Next;
end;

 

 

Worddoc.ActiveDocument.Tables.item(1).borders.item(-2).LineStyle := 1;
Worddoc.ActiveDocument.Tables.item(1).borders.item(-4).LineStyle := 1;
Worddoc.ActiveDocument.Tables.item(1).borders.item(-1).LineStyle := 1;
Worddoc.ActiveDocument.Tables.item(1).borders.item(-3).LineStyle := 1;
Worddoc.ActiveDocument.Tables.item(1).borders.item(-5).LineStyle := 1;
Worddoc.ActiveDocument.Tables.item(1).borders.item(-6).LineStyle := 1;

 

end;

procedure TForm1.img6Click(Sender: TObject);
var
XL, XArr: Variant;
i: Integer;
j: Integer;
begin

XArr:=VarArrayCreate([1,Memo1.Columns.Count],varVariant);
XL:=CreateOLEObject('Excel.Application');
XL.WorkBooks.add;
XL.visible:=true;
j:=1;
i:=1;

while i<=Memo1.Columns.Count do
begin
XArr[i] := Memo1.Columns.Items[i-1].FieldName;
XL.Range['A'+IntToStr(j),
CHR(64+Memo1.Columns.Count)+IntToStr(j)].Value := XArr;
i := i+1;
end;
XL.Range['A1', CHR(64+Memo1.Columns.Count)+IntToStr(1)].select;
XL.selection.font.Bold:=true;
XL.Selection.Font.ColorIndex := 5;
XL.Selection.Interior.ColorIndex := 48;
j := 2;
qry1.First;
while not qry1.Eof do
begin
i:=1;
while i<=Memo1.Columns.Count do
begin
XArr[i] := qry1.FieldValues[Memo1.Columns.Items[i-1].FieldName];
i := i+1;
end;
XL.Range['A'+IntToStr(j),
CHR(64+Memo1.Columns.Count)+IntToStr(j)].Value := XArr;
qry1.Next;
j:=j+1;
end;
XL.Range['A1',CHR(64+Memo1.Columns.Count)+IntToStr(j)].select;
XL.Selection.Font.Name:='Times New Roman';
XL.Selection.Font.Size:=12;
XL.selection.Columns.AutoFit;
XL.Range['A1','A1'].select;
end;

procedure TForm1.Belgilash1Click(Sender: TObject);
begin
form7.show;
end;

procedure TForm1.img9Click(Sender: TObject);
begin
Form7.Show;
end;

procedure TForm1.img10Click(Sender: TObject);
var ss:string;
begin
ss:=ExtractFileDir(Application.ExeName)+'/HELPs/HELP.htm';
ShellExecute (Form1.Handle, nil, PAnsichar(ss), nil, nil, SW_MAXIMIZE);
end;

procedure TForm1.img13Click(Sender: TObject);
begin
Form3.frxrprt1.print;

end;

procedure TForm1.img12Click(Sender: TObject);
begin
Form3.frxrprt1.Export(form3.frxhtmlxprt1);

end;

procedure TForm1.img8Click(Sender: TObject);
begin
Nastroyka.Show;

end;

procedure TForm1.img11Click(Sender: TObject);
begin
Form3.frxrprt1.Export(form3.frxpdfxprt1);

end;

procedure TForm1.img14Click(Sender: TObject);
begin
Form3.show;
Form3.frxrprt1.ShowReport;

end;

procedure TForm1.N2Click(Sender: TObject);
begin
Form2.ShowModal;
end;

procedure TForm1.N3Click(Sender: TObject);
begin
Form4.ShowModal;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.Visible:=false;
end;

procedure TForm1.QoshishCtrlD1Click(Sender: TObject);
begin
form2.show;
qry1.Insert;
end;

procedure TForm1.OzgatirishCtrlI1Click(Sender: TObject);
begin
Form2.ShowModal;
end;

procedure TForm1.OchirishCtrlU1Click(Sender: TObject);
begin
Form4.ShowModal;
end;

procedure TForm1.mniQoshish1Click(Sender: TObject);
begin
form2.show;
qry1.Insert;
end;

procedure TForm1.mniOzgartirish1Click(Sender: TObject);
begin
Form9.Show;
end;

procedure TForm1.mniOchirish1Click(Sender: TObject);
begin
b:=StrToFloat(edt2.Text);
case d of
'-':c:=a-b;
'+':c:=a+b;
'*':c:=a*b;
'/':c:=a/b;
end;
edt2.Text:=FloatToStr(c);
end;

procedure TForm1.lbledt1Change(Sender: TObject);
begin
qry1.Close;
qry1.SQL.Clear;
qry1.SQL.Add('select * from Talaba');
qry1.SQL.Add('where');
qry1.SQL.Add('(Familiya LIKE "'+ lbledt1.Text + '%' + '")and(Fakultet LIKE "'+ lbledt2.Text + '%' + '")');
qry1.SQL.Add('and(Kurs LIKE "'+ lbledt3.Text + '%' + '")');
qry1.SQL.Add('and(Sana LIKE "'+ lbledt4.Text + '%' + '")');
qry1.SQL.Add('and(ID LIKE "'+ lbledt5.Text + '%' + '")');
qry1.SQL.Add('order by Id;');
qry1.Open;
qry1.Active:=true;
end;

procedure TForm1.lbledt3Change(Sender: TObject);
begin
qry1.Close;
qry1.SQL.Clear;
qry1.SQL.Add('select * from Talaba');
qry1.SQL.Add('where');
qry1.SQL.Add('(Familiya LIKE "'+ lbledt1.Text + '%' + '")and(Fakultet LIKE "'+ lbledt2.Text + '%' + '")');
qry1.SQL.Add('and(Kurs LIKE "'+ lbledt3.Text + '%' + '")');
qry1.SQL.Add('and(Sana LIKE "'+ lbledt4.Text + '%' + '")');
qry1.SQL.Add('and(ID LIKE "'+ lbledt5.Text + '%' + '")');
qry1.SQL.Add('order by Id;');
qry1.Open;
qry1.Active:=true;
end;

procedure TForm1.lbledt2Change(Sender: TObject);
begin
qry1.Close;
qry1.SQL.Clear;
qry1.SQL.Add('select * from Talaba');
qry1.SQL.Add('where');
qry1.SQL.Add('(Familiya LIKE "'+ lbledt1.Text + '%' + '")and(Fakultet LIKE "'+ lbledt2.Text + '%' + '")');
qry1.SQL.Add('and(Kurs LIKE "'+ lbledt3.Text + '%' + '")');
qry1.SQL.Add('and(Sana LIKE "'+ lbledt4.Text + '%' + '")');
qry1.SQL.Add('and(ID LIKE "'+ lbledt5.Text + '%' + '")');
qry1.SQL.Add('order by Id;');
qry1.Open;
qry1.Active:=true;
end;

procedure TForm1.lbledt4Change(Sender: TObject);
begin
qry1.Close;
qry1.SQL.Clear;
qry1.SQL.Add('select * from Talaba');
qry1.SQL.Add('where');
qry1.SQL.Add('(Familiya LIKE "'+ lbledt1.Text + '%' + '")and(Fakultet LIKE "'+ lbledt2.Text + '%' + '")');
qry1.SQL.Add('and(Kurs LIKE "'+ lbledt3.Text + '%' + '")');
qry1.SQL.Add('and(Sana LIKE "'+ lbledt4.Text + '%' + '")');
qry1.SQL.Add('and(ID LIKE "'+ lbledt5.Text + '%' + '")');
qry1.SQL.Add('order by Id;');
qry1.Open;
qry1.Active:=true;
end;

procedure TForm1.btn10Click(Sender: TObject);
begin
edt2.text:=edt2.text +(Sender as TButton).Caption;
end;

procedure TForm1.btn13Click(Sender: TObject);
begin
a:=StrToFloat(edt2.Text);
edt2.Clear;
case (Sender as TButton).Tag of
1: d:='-';
2: d:='+';
3: d:='*';
4: d:='/';
end;

end;

procedure TForm1.btn17Click(Sender: TObject);
var s:string;
begin
s:=edt2.Text;
if s=''then Exit;

Delete(s,Length(s),1);
edt2.Text:=s;
end;

procedure TForm1.btn18Click(Sender: TObject);
begin
edt2.Clear;
end;

procedure TForm1.edt1KeyPress(Sender: TObject; var Key: Char);
begin
case Key of
'-',',','0'..'9',#8: else key:=Chr(0);
end;
end;

procedure TForm1.ComboBox2Select(Sender: TObject);
begin
if ComboBox2.Text='Pedagoglar' then
begin
Form1.qry1.Close;
Form1.qry1.SQL.Clear;
Form1.qry1.SQL.Add('select * from Pedagoglar');
Form1.qry1.Open;
Form1.qry1.Active:=true;
end;
if ComboBox2.Text='Talabalar' then
begin
Form1.qry1.Close;
Form1.qry1.SQL.Clear;
Form1.qry1.SQL.Add('select * from Talaba');
Form1.qry1.Open;
Form1.qry1.Active:=true;
end;

if ComboBox2.Text='Magistrlar' then
begin
Form1.qry1.Close;
Form1.qry1.SQL.Clear;
Form1.qry1.SQL.Add('select * from Talaba2;');
Form1.qry1.Open;
Form1.qry1.Active:=true;
end;
if ComboBox2.Text='Aholi' then
begin
Form1.qry1.Close;
Form1.qry1.SQL.Clear;
Form1.qry1.SQL.Add('select * from Aholi;');
Form1.qry1.Open;
Form1.qry1.Active:=true;
end;
end;
procedure TForm1.Memo1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if (qry1.FieldByName('Sana').Value mod 2 = 0) then
with Memo1.Canvas do
begin
Font.Color :=clPurple;
FillRect(Rect);
TextOut(Rect.Left + 2, Rect.Top + 2, Column.Field.Text);
end
else
with Memo1.Canvas do
begin
Font.Color := clMaroon;
FillRect(Rect);
TextOut(Rect.Left + 2, Rect.Top + 2, Column.Field.Text);
end;

if FileExists(ExtractFileDir(Application.ExeName)+'\folders\'+DBText5.Caption+'\'+DBText5.Caption+'.jpg') then
Image10.Picture.LoadFromFile(ExtractFileDir(Application.ExeName)+'\folders\'+DBText5.Caption+'\'+DBText5.Caption+'.jpg') else
if FileExists(ExtractFileDir(Application.ExeName)+'\folders\'+DBText5.Caption+'\'+DBText5.Caption+'.bmp') then
Image10.Picture.LoadFromFile(ExtractFileDir(Application.ExeName)+'\folders\'+DBText5.Caption+'\'+DBText5.Caption+'.bmp') else
Image10.Picture.LoadFromFile(ExtractFileDir(Application.ExeName)+'\fotos\'+'default.bmp');

end;

procedure TForm1.qry1AfterOpen(DataSet: TDataSet);
begin
lbl3.Caption:=inttostr(qry1.RecordCount)+' Talaba';
end;

procedure TForm1.btn1Click(Sender: TObject);
var ss:string;
begin
ss:=ExtractFileDir(Application.ExeName)+'/HELPs/HELP.htm';
ShellExecute (Form1.Handle, nil, PAnsichar(ss), nil, nil, SW_MAXIMIZE);
end;

procedure TForm1.img10MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
img10.Picture.LoadFromFile(ExtractFileDir(Application.ExeName)+'\buttons\button28.bmp');
end;

procedure TForm1.img10MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
img10.Picture.LoadFromFile(ExtractFileDir(Application.ExeName)+'\buttons\button27.bmp');
end;

procedure TForm1.dtp1Click(Sender: TObject);
begin
qry1.Close;
qry1.SQL.Clear;
qry1.SQL.Add('select * from Talaba');
qry1.SQL.Add('where');
qry1.SQL.Add('(Familiya LIKE "'+ lbledt1.Text + '%' + '")and(Fakultet LIKE "'+ lbledt2.Text + '%' + '")');
qry1.SQL.Add('and(Kurs LIKE "'+ lbledt3.Text + '%' + '")');
qry1.SQL.Add('and(Sana LIKE "'+ lbledt4.Text + '%' + '")');
qry1.SQL.Add('order by Id;');
qry1.Open;
qry1.Active:=true;
end;

end.

Forma 2

Kodi quyida keltirilgan
unit Unit2;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, DBCtrls, Mask;

type
TForm2 = class(TForm)
DBEdit1: TDBEdit;
DBComboBox1: TDBComboBox;
DBComboBox2: TDBComboBox;
StaticText1: TStaticText;
StaticText2: TStaticText;
StaticText3: TStaticText;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;

implementation

uses Unit1;

{$R *.dfm}

procedure TForm2.BitBtn1Click(Sender: TObject);
begin
Form1.ADOQuery1.Post;
end;

end.

 

Bizda talaba.mdb access da ma’lumotlar ombori mavjud bu quyidagi strukturaga ega bo`lishi kerak.

Dasturni yuklab oling va undan foydalaning.

Dasturni yuklab olish

767 marta o`qildi.

Parol:
Eslab qolish.


Ro`yhatdan o`tish

testing

+998915878681

Siz o`z maxsulotingizni 3D reklama ko`rinishda bo`lishini xohlaysizmi? Unda xamkorlik qilamiz.

3D Reklama


Рейтинг@Mail.ru
Рейтинг@Mail.ru

Besucherzahler
счетчик посещений