ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/dbInfo/Unit1.pas
(Generate patch)

Comparing ibx/trunk/examples/dbInfo/Unit1.pas (file contents):
Revision 142 by tony, Mon Jan 1 11:31:13 2018 UTC vs.
Revision 143 by tony, Fri Feb 23 12:11:21 2018 UTC

# Line 1 | Line 1
1 + (*
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   unit Unit1;
28  
29   {$mode objfpc}{$H+}
# Line 25 | Line 51 | type
51      { private declarations }
52      procedure ShowBoolValue(aValue: Long; WhenTrue, WhenFalse: string);
53      procedure ShowStrings(aCaption: string; List: TStrings);
54 +    function HexString(s: AnsiString): string;
55    public
56      { public declarations }
57    end;
# Line 60 | Line 87 | procedure TForm1.IBDatabase1AfterConnect
87   begin
88    IBTransaction1.Active := true;
89    TableNameLookup.Active := true;
90 +  Memo1.Lines.Add('Authentication Method = '+ IBDatabase1.AuthenticationMethod);
91 +  Memo1.Lines.Add('Remote Protocol = ' + IBDatabase1.RemoteProtocol);
92 +  Memo1.Lines.Add('Attachment SQLDialect = ' + IntToStr(IBDatabase1.DBSQLDialect));
93    with IBDatabaseInfo1 do
94    begin
95 +    Memo1.Lines.Add('DB SQLDialect = ' + IntToStr(DBSQLDialect));
96      Memo1.Lines.Add('Allocation = ' + IntToStr(Allocation));
97      Memo1.Lines.Add('Base Level = ' + IntToStr(BaseLevel));
98      Memo1.Lines.Add('DB File Name = ' + DBFileName);
99      Memo1.Lines.Add('DB Site Name = ' + DBSiteName);
100      Memo1.Lines.Add('DB Implementation No = ' + IntToStr(DBImplementationNo));
101 +    Memo1.Lines.Add('Database Created: ' + DateTimeToStr(DateDBCreated));
102      Memo1.Lines.Add('DB Implementation Class = ' + IntToStr(DBImplementationClass));
103      ShowBoolValue(NoReserve, 'No Space Reserved','Space is Reserved');
104      Memo1.Lines.Add('ODS Minor Version = ' + IntToStr(ODSMinorVersion));
# Line 83 | Line 115 | begin
115      Memo1.Lines.Add('Marks = ' + IntToStr(Marks));
116      Memo1.Lines.Add('Reads = ' + IntToStr(Reads));
117      Memo1.Lines.Add('Writes = ' + IntToStr(Writes));
118 +    if ODSMajorVersion >= 12 then
119 +    begin
120 +      Memo1.Lines.Add('Pages Free = ' + IntToStr(PagesFree));
121 +      Memo1.Lines.Add('Pages Used = ' + IntToStr(PagesUsed));
122 +    end;
123 +    Memo1.Lines.Add('Transaction Count = ' + IntToStr(TransactionCount));
124      AddPerfStats('Backout Count',BackoutCount);
125      AddPerfStats('Delete Count',DeleteCount);
126      AddPerfStats('Expunge Count',ExpungeCount);
# Line 92 | Line 130 | begin
130      AddPerfStats('Read Seq Count',ReadSeqCount);
131      AddPerfStats('Update Count',UpdateCount);
132      Memo1.Lines.Add('');
95    Memo1.Lines.Add('DB SQLDialect = ' + IntToStr(DBSQLDialect));
133      ShowBoolValue(ReadOnly,'Database is Read Only','Database is Read/Write');
134 +    Memo1.Lines.Add('Hex Dump of Database Page 100:');
135 +    Memo1.Lines.Add(HexString(GetDatabasePage(100)));
136    end;
137   end;
138  
# Line 119 | Line 158 | begin
158    Memo1.Lines.Add(s);
159   end;
160  
161 + function TForm1.HexString(s: AnsiString): string;
162 + var i: integer;
163 + begin
164 +  Result := '';
165 +  for i := 1 to length(s) do
166 +    Result += Format('%x ',[byte(s[i])]);
167 + end;
168 +
169   procedure TForm1.AddPerfStats(Heading: string;
170    stats: TStrings);
171   var i: integer;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines