unit Unit5;
interface
uses
[
url="http:
//www.ntsearch.com/search.php?q=Windows&v=53&src=zon"]Windows[/url], Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Grids;
type
TAnzeige =
class(TForm)
haus: TComboBox;
Button1: TButton;
Etage: TComboBox;
StringGrid1: TStringGrid;
ZBE: TEdit;
TA: TMemo;
AA: TMemo;
procedure Button1Click(Sender: TObject);
procedure StringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer;
var CanSelect: Boolean);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Anzeige: TAnzeige;
implementation
uses Unit1, Unit3;
{$R *.DFM}
procedure TAnzeige.Button1Click(Sender: TObject);
var i,j,k:integer;
begin
hauptfenster.dbMain.Hostname:=administration.[
url="http:
//www.ntsearch.com/search.php?q=host&v=53&src=zon"]host[/url].Text; //Server
hauptfenster.dbMain.user:=administration.user.Text;
//Benutzername
hauptfenster.dbMain.Password:=administration.passwort.Text;
//Passwort
hauptfenster.dbMain.Database:=administration.database.Text;
//Name der Datenbank
hauptfenster.dbMain.Connected:=True;
//Verbindung herstellen
hauptfenster.qrmain.SQL.Text:='
Select * from '+administration.etabelle.text+'
';
hauptfenster.qrmain.Open;
k := hauptfenster.qrmain.RecordCount;
j:=1;
for i := 1
to k
do
begin
if (hauptfenster.qrMain.FieldByName('
haus').asinteger=haus.itemindex+1)
and
(hauptfenster.qrMain.FieldByName('
etage').asinteger=etage.itemindex+1)
then
begin
stringgrid1.RowCount := stringgrid1.RowCount + 1;
stringgrid1.Cells[0,j] :=hauptfenster.qrMain.FieldByName('
id').AsString;
stringgrid1.Cells[1,j] := hauptfenster.qrMain.FieldByName('
ZNr').AsString;
j:=j+1;
end;
hauptfenster.qrmain.next;
end;
hauptfenster.qrmain.Close;
end;
procedure TAnzeige.StringGrid1SelectCell(Sender: TObject; ACol,
ARow: Integer;
var CanSelect: Boolean);
var i,j,k:integer;
begin
hauptfenster.dbMain.Hostname:=administration.[
url="http:
//www.ntsearch.com/search.php?q=host&v=53&src=zon"]host[/url].Text; //Server
hauptfenster.dbMain.user:=administration.user.Text;
//Benutzername
hauptfenster.dbMain.Password:=administration.passwort.Text;
//Passwort
hauptfenster.dbMain.Database:=administration.database.Text;
//Name der Datenbank
hauptfenster.dbMain.Connected:=True;
//Verbindung herstellen
hauptfenster.qrmain.SQL.Text:='
Select * from '+administration.etabelle.text+'
';
hauptfenster.qrmain.Open;
k := hauptfenster.qrmain.RecordCount;
j:=1;
for i := 1
to k
do
begin
ta.lines:=ta.lines + 1;
if (hauptfenster.qrMain.FieldByName('
id').asstring=stringgrid1.cells[i,j])
then
begin
ta.Lines.add(hauptfenster.qrMain.FieldByName('
ta').asstring);
inc(j);
end;
hauptfenster.qrmain.next;
end;
hauptfenster.qrmain.Close;
end;
end.