ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/scriptengine/unit2.pas
Revision: 143
Committed: Fri Feb 23 12:11:21 2018 UTC (6 years, 2 months ago) by tony
Content type: text/x-pascal
File size: 1939 byte(s)
Log Message:
Fixes Merged

File Contents

# User Rev Content
1 tony 143 (*
2     * IBX For Lazarus (Firebird Express)
3     *
4     * The contents of this file are subject to the Initial Developer's
5     * Public License Version 1.0 (the "License"); you may not use this
6     * file except in compliance with the License. You may obtain a copy
7     * of the License here:
8     *
9     * http://www.firebirdsql.org/index.php?op=doc&id=idpl
10     *
11     * Software distributed under the License is distributed on an "AS
12     * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
13     * implied. See the License for the specific language governing rights
14     * and limitations under the License.
15     *
16     * The Initial Developer of the Original Code is Tony Whyman.
17     *
18     * The Original Code is (C) 2015 Tony Whyman, MWA Software
19     * (http://www.mwasoftware.co.uk).
20     *
21     * All Rights Reserved.
22     *
23     * Contributor(s): ______________________________________.
24     *
25     *)
26    
27 tony 37 unit Unit2;
28    
29     {$mode objfpc}{$H+}
30    
31     interface
32    
33     uses
34     Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, db,
35     IBDynamicGrid, IBQuery, IBDatabase;
36    
37     type
38    
39     { TSelectSQLResults }
40    
41     TSelectSQLResults = class(TForm)
42     DataSource1: TDataSource;
43     IBDynamicGrid1: TIBDynamicGrid;
44     IBTransaction1: TIBTransaction;
45     SelectQuery: TIBQuery;
46     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
47     procedure FormShow(Sender: TObject);
48     private
49     { private declarations }
50     public
51     { public declarations }
52     procedure Show(SelectSQLText: string);
53     end;
54    
55     var
56     SelectSQLResults: TSelectSQLResults;
57    
58     implementation
59    
60     {$R *.lfm}
61    
62     { TSelectSQLResults }
63    
64     procedure TSelectSQLResults.FormShow(Sender: TObject);
65     begin
66     SelectQuery.Active := true;
67     end;
68    
69     procedure TSelectSQLResults.FormClose(Sender: TObject;
70     var CloseAction: TCloseAction);
71     begin
72     SelectQuery.ACtive := false;
73     CloseAction := caFree;
74     end;
75    
76     procedure TSelectSQLResults.Show(SelectSQLText: string);
77     begin
78     SelectQuery.SQL.Text := SelectSQLText;
79     inherited Show;
80     end;
81    
82     end.
83