home *** CD-ROM | disk | FTP | other *** search
- unit client1;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- Db, DBTables, StdCtrls,comobj, ExtCtrls, DBCtrls, Grids, DBGrids;
-
- type
- TForm1 = class(TForm)
- Edit1: TEdit;
- Button1: TButton;
- DataSource1: TDataSource;
- Table1: TTable;
- Label1: TLabel;
- DBGrid1: TDBGrid;
- DBNavigator1: TDBNavigator;
- procedure Button1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- controlusu:Variant;
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- uses client2;
-
- {$R *.DFM}
-
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- table1.active:=false;
- table1.readonly:=false;
- if controlusu.sololectura(edit1.text) = 0 then
- begin
- table1.open;
- if controlusu.busqueda(edit1.text) = 0 then
- begin
- dbgrid1.columns.items[2].visible:=true;
- Application.CreateForm(TForm2, Form2);
- form2.show;
- end
- else
- dbgrid1.columns.items[2].visible:=false;
- end
- else
- begin
- table1.close;
- table1.readonly:=true;
- Table1.open;
- end;
- end;
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- controlusu:=CreateOleObject('pserver1.controlusu');
- end;
-
- end.
-
-
-
-