Стартовый пул
This commit is contained in:
139
ZEOSDBO/examples/controls/ZControlsExample.dof
Normal file
139
ZEOSDBO/examples/controls/ZControlsExample.dof
Normal file
@@ -0,0 +1,139 @@
|
||||
[FileVersion]
|
||||
Version=6.0
|
||||
[Compiler]
|
||||
A=8
|
||||
B=0
|
||||
C=1
|
||||
D=1
|
||||
E=0
|
||||
F=0
|
||||
G=1
|
||||
H=1
|
||||
I=1
|
||||
J=0
|
||||
K=0
|
||||
L=1
|
||||
M=0
|
||||
N=1
|
||||
O=1
|
||||
P=1
|
||||
Q=0
|
||||
R=0
|
||||
S=0
|
||||
T=0
|
||||
U=0
|
||||
V=1
|
||||
W=0
|
||||
X=1
|
||||
Y=1
|
||||
Z=1
|
||||
ShowHints=1
|
||||
ShowWarnings=1
|
||||
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
[Linker]
|
||||
MapFile=0
|
||||
OutputObjs=0
|
||||
ConsoleApp=1
|
||||
DebugInfo=0
|
||||
RemoteSymbols=0
|
||||
MinStackSize=16384
|
||||
MaxStackSize=1048576
|
||||
ImageBase=4194304
|
||||
ExeDescription=
|
||||
[Directories]
|
||||
OutputDir=
|
||||
UnitOutputDir=
|
||||
PackageDLLOutputDir=
|
||||
PackageDCPOutputDir=
|
||||
SearchPath=
|
||||
Packages=vcl;rtl;vclx;bdertl;dsnap;dbrtl;inetdb;inet;vcldb;vcldbx;adortl;dclaxserver;bdecds;cds;dbexpress;dbxcds;dss;teeui;teedb;tee;ibxpress;vclie;indy;dsnapcrba;dsnapcon;xmlrtl;inetdbbde;inetdbxpress;nmfast;qrpt;vclshlctrls;VclSmp;soaprtl;teeqr;webdsnap;websnap;visualclx;visualdbclx;xmlide;delphicorba;corbaide;proide
|
||||
Conditionals=
|
||||
DebugSourceDirs=
|
||||
UsePackages=0
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
Launcher=
|
||||
UseLauncher=0
|
||||
DebugCWD=
|
||||
[Language]
|
||||
ActiveLang=
|
||||
ProjectLang=
|
||||
RootDir=C:\Program Files\Borland\Delphi6\Bin\
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=1049
|
||||
CodePage=1251
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
[Excluded Packages]
|
||||
c:\program files\borland\delphi6\Bin\stride60.bpl=String Resource Editor IDE Package
|
||||
C:\Program Files\Borland\Delphi6\Bin\vclhie60.bpl=Internet Explorer Hosting Support Package
|
||||
c:\program files\borland\delphi6\Bin\delphipro60.bpl=Borland Delphi Professional IDE Package
|
||||
c:\program files\borland\delphi6\Bin\designdgm60.bpl=Borland Module Diagram Editview
|
||||
c:\program files\borland\delphi6\Bin\delphicorba60.bpl=Borland Delphi Core IDE CORBA Package
|
||||
c:\program files\borland\delphi6\Bin\delphient60.bpl=C++Builder Enterprise IDE Package
|
||||
c:\program files\borland\delphi6\Bin\xmlide60.bpl=Borland XML IDE Package
|
||||
c:\program files\borland\delphi6\Bin\delphiclxide60.bpl=(untitled)
|
||||
C:\Program Files\Borland\Delphi6\Bin\clxdesigner60.bpl=CLX Form designer and property and component editors
|
||||
c:\program files\borland\delphi6\Bin\direct60.bpl=Borland Direct IDE Package
|
||||
c:\program files\borland\delphi6\Bin\delphihtm60.bpl=Borland Delphi Core HTML Package
|
||||
C:\Program Files\Borland\Delphi6\Bin\indy60.bpl=Internet Direct (Indy) for D6
|
||||
c:\program files\borland\delphi6\Projects\Bpl\Ehlib.bpl=EhLib 2.3
|
||||
c:\program files\borland\delphi6\Projects\Bpl\Dfs60D.bpl=DFS Components
|
||||
c:\program files\borland\delphi6\Projects\Bpl\ABTComponents6.bpl=AbtLib 0.1.b1
|
||||
c:\program files\borland\delphi6\Bin\dcloffice2k60.bpl=Microsoft Office 2000 Sample Automation Server Wrapper Components
|
||||
c:\program files\borland\delphi6\Projects\Bpl\dGJLSoftwareD5.bpl=GJL Software ExDBGrid Components
|
||||
c:\program files\borland\delphi6\Projects\Bpl\ffADOSQLUtil.bpl=FF ADO SQL Utility Component
|
||||
c:\program files\borland\delphi6\Projects\Bpl\MST6.bpl=(untitled)
|
||||
[HistoryLists\hlDebugSourcePath]
|
||||
Count=3
|
||||
Item0=$(ZEOSDBO_BUILD)
|
||||
Item1=C:\Program Files\Borland\zeos\zeosdbo_rework\packages\delphi5\build
|
||||
Item2=build
|
||||
[HistoryLists\hlUnitAliases]
|
||||
Count=1
|
||||
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
[HistoryLists\hlSearchPath]
|
||||
Count=4
|
||||
Item0=$(DELPHI)\Lib\Debug
|
||||
Item1=$(ZEOSDBO_BUILD)
|
||||
Item2=C:\Program Files\Borland\zeos\zeosdbo_rework\packages\delphi5\build
|
||||
Item3=build
|
||||
[HistoryLists\hlUnitOutputDirectory]
|
||||
Count=3
|
||||
Item0=$(ZEOSDBO_BUILD)
|
||||
Item1=C:\Program Files\Borland\zeos\zeosdbo_rework\packages\delphi5\build
|
||||
Item2=build
|
||||
[HistoryLists\hlOutputDirectorry]
|
||||
Count=1
|
||||
Item0=$(ZEOSDBO_BUILD)
|
||||
[HistoryLists\hlBPLOutput]
|
||||
Count=3
|
||||
Item0=$(ZEOSDBO_BUILD)
|
||||
Item1=C:\Program Files\Borland\zeos\zeosdbo_rework\packages\delphi5\build
|
||||
Item2=build
|
||||
[HistoryLists\hlDCPOutput]
|
||||
Count=3
|
||||
Item0=$(ZEOSDBO_BUILD)
|
||||
Item1=C:\Program Files\Borland\zeos\zeosdbo_rework\packages\delphi5\build
|
||||
Item2=build
|
13
ZEOSDBO/examples/controls/ZControlsExample.dpr
Normal file
13
ZEOSDBO/examples/controls/ZControlsExample.dpr
Normal file
@@ -0,0 +1,13 @@
|
||||
program ZControlsExample;
|
||||
|
||||
uses
|
||||
Forms,
|
||||
main in 'main.pas' {MainForm};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
Application.Run;
|
||||
end.
|
526
ZEOSDBO/examples/controls/main.dfm
Normal file
526
ZEOSDBO/examples/controls/main.dfm
Normal file
@@ -0,0 +1,526 @@
|
||||
object MainForm: TMainForm
|
||||
Left = 207
|
||||
Top = 192
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'Controls example'
|
||||
ClientHeight = 446
|
||||
ClientWidth = 688
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object Label12: TLabel
|
||||
Left = 306
|
||||
Top = 3
|
||||
Width = 48
|
||||
Height = 13
|
||||
Caption = 'Username'
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 688
|
||||
Height = 46
|
||||
Align = alTop
|
||||
TabOrder = 0
|
||||
object Label1: TLabel
|
||||
Left = 363
|
||||
Top = 3
|
||||
Width = 48
|
||||
Height = 13
|
||||
Caption = 'Username'
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 6
|
||||
Top = 3
|
||||
Width = 39
|
||||
Height = 13
|
||||
Caption = 'Protocol'
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 432
|
||||
Top = 3
|
||||
Width = 46
|
||||
Height = 13
|
||||
Caption = 'Password'
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 126
|
||||
Top = 3
|
||||
Width = 46
|
||||
Height = 13
|
||||
Caption = 'Database'
|
||||
end
|
||||
object SpeedButton1: TSpeedButton
|
||||
Left = 222
|
||||
Top = 18
|
||||
Width = 23
|
||||
Height = 22
|
||||
Caption = '...'
|
||||
Flat = True
|
||||
OnClick = SpeedButton1Click
|
||||
end
|
||||
object SpeedButton2: TSpeedButton
|
||||
Left = 501
|
||||
Top = 15
|
||||
Width = 64
|
||||
Height = 25
|
||||
Caption = 'Connect'
|
||||
Flat = True
|
||||
OnClick = SpeedButton2Click
|
||||
end
|
||||
object Label13: TLabel
|
||||
Left = 315
|
||||
Top = 3
|
||||
Width = 19
|
||||
Height = 13
|
||||
Caption = 'Port'
|
||||
end
|
||||
object Label14: TLabel
|
||||
Left = 246
|
||||
Top = 3
|
||||
Width = 22
|
||||
Height = 13
|
||||
Caption = 'Host'
|
||||
end
|
||||
object SpeedButton3: TSpeedButton
|
||||
Left = 567
|
||||
Top = 15
|
||||
Width = 67
|
||||
Height = 25
|
||||
Caption = 'Disconnect'
|
||||
Flat = True
|
||||
OnClick = SpeedButton3Click
|
||||
end
|
||||
object ZProtocol: TComboBox
|
||||
Left = 6
|
||||
Top = 18
|
||||
Width = 118
|
||||
Height = 21
|
||||
ItemHeight = 13
|
||||
TabOrder = 0
|
||||
Text = 'mysql-3.23'
|
||||
Items.Strings = (
|
||||
'')
|
||||
end
|
||||
object ZPassword: TEdit
|
||||
Left = 432
|
||||
Top = 18
|
||||
Width = 67
|
||||
Height = 21
|
||||
PasswordChar = '*'
|
||||
TabOrder = 3
|
||||
end
|
||||
object ZDatabase: TEdit
|
||||
Left = 126
|
||||
Top = 18
|
||||
Width = 94
|
||||
Height = 21
|
||||
TabOrder = 1
|
||||
Text = 'zeoslib'
|
||||
end
|
||||
object ZUername: TEdit
|
||||
Left = 363
|
||||
Top = 18
|
||||
Width = 67
|
||||
Height = 21
|
||||
TabOrder = 2
|
||||
Text = 'root'
|
||||
end
|
||||
end
|
||||
object PageControl1: TPageControl
|
||||
Left = 0
|
||||
Top = 46
|
||||
Width = 688
|
||||
Height = 400
|
||||
ActivePage = TabSheet2
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
object TabSheet2: TTabSheet
|
||||
Caption = 'Simple'
|
||||
ImageIndex = 1
|
||||
object DBGrid1: TDBGrid
|
||||
Left = 0
|
||||
Top = 30
|
||||
Width = 680
|
||||
Height = 342
|
||||
Align = alBottom
|
||||
DataSource = DSCargo
|
||||
TabOrder = 0
|
||||
TitleFont.Charset = DEFAULT_CHARSET
|
||||
TitleFont.Color = clWindowText
|
||||
TitleFont.Height = -11
|
||||
TitleFont.Name = 'MS Sans Serif'
|
||||
TitleFont.Style = []
|
||||
end
|
||||
object DBNavigator2: TDBNavigator
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 240
|
||||
Height = 25
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
object TabSheet1: TTabSheet
|
||||
Caption = 'Data Controls'
|
||||
object Label5: TLabel
|
||||
Left = 3
|
||||
Top = 168
|
||||
Width = 11
|
||||
Height = 13
|
||||
Caption = 'ID'
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 57
|
||||
Top = 168
|
||||
Width = 28
|
||||
Height = 13
|
||||
Caption = 'Name'
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 3
|
||||
Top = 210
|
||||
Width = 87
|
||||
Height = 13
|
||||
Caption = 'Begin of work time'
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 129
|
||||
Top = 210
|
||||
Width = 90
|
||||
Height = 13
|
||||
Caption = 'Finish of work time '
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 3
|
||||
Top = 249
|
||||
Width = 39
|
||||
Height = 13
|
||||
Caption = 'Resume'
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 459
|
||||
Top = 138
|
||||
Width = 28
|
||||
Height = 13
|
||||
Caption = 'Photo'
|
||||
end
|
||||
object Label11: TLabel
|
||||
Left = 258
|
||||
Top = 165
|
||||
Width = 55
|
||||
Height = 13
|
||||
Caption = 'Department'
|
||||
end
|
||||
object DBGrid: TDBGrid
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 680
|
||||
Height = 133
|
||||
Align = alTop
|
||||
DataSource = DSPeople
|
||||
ReadOnly = True
|
||||
TabOrder = 10
|
||||
TitleFont.Charset = DEFAULT_CHARSET
|
||||
TitleFont.Color = clWindowText
|
||||
TitleFont.Height = -11
|
||||
TitleFont.Name = 'MS Sans Serif'
|
||||
TitleFont.Style = []
|
||||
end
|
||||
object DBNavigator1: TDBNavigator
|
||||
Left = 3
|
||||
Top = 138
|
||||
Width = 240
|
||||
Height = 25
|
||||
DataSource = DSPeople
|
||||
TabOrder = 7
|
||||
end
|
||||
object DBId: TDBEdit
|
||||
Left = 3
|
||||
Top = 183
|
||||
Width = 49
|
||||
Height = 21
|
||||
DataField = 'p_id'
|
||||
DataSource = DSPeople
|
||||
TabOrder = 0
|
||||
end
|
||||
object DBName: TDBEdit
|
||||
Left = 57
|
||||
Top = 183
|
||||
Width = 196
|
||||
Height = 21
|
||||
DataField = 'p_name'
|
||||
DataSource = DSPeople
|
||||
TabOrder = 1
|
||||
end
|
||||
object DBBeginWorkTime: TDBEdit
|
||||
Left = 3
|
||||
Top = 225
|
||||
Width = 121
|
||||
Height = 21
|
||||
DataField = 'p_begin_work'
|
||||
DataSource = DSPeople
|
||||
TabOrder = 3
|
||||
end
|
||||
object DBResume: TDBMemo
|
||||
Left = 3
|
||||
Top = 264
|
||||
Width = 451
|
||||
Height = 109
|
||||
DataField = 'p_resume'
|
||||
DataSource = DSPeople
|
||||
TabOrder = 5
|
||||
end
|
||||
object DBPicture: TDBImage
|
||||
Left = 459
|
||||
Top = 153
|
||||
Width = 220
|
||||
Height = 219
|
||||
DataField = 'p_picture'
|
||||
DataSource = DSPeople
|
||||
TabOrder = 6
|
||||
end
|
||||
object DBEndWorkTime: TDBEdit
|
||||
Left = 129
|
||||
Top = 225
|
||||
Width = 121
|
||||
Height = 21
|
||||
DataField = 'p_end_work'
|
||||
DataSource = DSPeople
|
||||
TabOrder = 4
|
||||
end
|
||||
object LoadImageBtn: TButton
|
||||
Left = 336
|
||||
Top = 138
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Load Image'
|
||||
TabOrder = 9
|
||||
OnClick = LoadImageBtnClick
|
||||
end
|
||||
object LoadResumeBtn: TButton
|
||||
Left = 249
|
||||
Top = 138
|
||||
Width = 82
|
||||
Height = 25
|
||||
Caption = 'Load Resume'
|
||||
TabOrder = 8
|
||||
OnClick = LoadResumeBtnClick
|
||||
end
|
||||
object DBDepartment: TDBLookupComboBox
|
||||
Left = 258
|
||||
Top = 183
|
||||
Width = 145
|
||||
Height = 21
|
||||
DataField = 'p_dep_id'
|
||||
DataSource = DSPeople
|
||||
DropDownRows = 5
|
||||
KeyField = 'dep_id'
|
||||
ListField = 'dep_name'
|
||||
ListSource = DSDepartment
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object TabSheet3: TTabSheet
|
||||
Caption = 'Info'
|
||||
ImageIndex = 2
|
||||
object Panel2: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 680
|
||||
Height = 28
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
TabOrder = 0
|
||||
object ZDBInfoType: TComboBox
|
||||
Left = 3
|
||||
Top = 3
|
||||
Width = 145
|
||||
Height = 21
|
||||
ItemHeight = 13
|
||||
TabOrder = 0
|
||||
OnChange = ZDBInfoTypeChange
|
||||
Items.Strings = (
|
||||
'Procedures'
|
||||
'ProcedureColumns'
|
||||
'Tables'
|
||||
'Schemas'
|
||||
'Catalogs'
|
||||
'TableTypes'
|
||||
'Columns'
|
||||
'ColumnPrivileges'
|
||||
'TablePrivileges'
|
||||
'BestRowIdentifier'
|
||||
'VersionColumns'
|
||||
'PrimaryKeys'
|
||||
'ImportedKeys'
|
||||
'ExportedKeys'
|
||||
'CrossReference'
|
||||
'TypeInfo'
|
||||
'IndexInfo'
|
||||
'UserDefinedTypes')
|
||||
end
|
||||
end
|
||||
object DBGrid2: TDBGrid
|
||||
Left = 0
|
||||
Top = 28
|
||||
Width = 680
|
||||
Height = 344
|
||||
Align = alClient
|
||||
DataSource = DSSQLMetadata
|
||||
TabOrder = 1
|
||||
TitleFont.Charset = DEFAULT_CHARSET
|
||||
TitleFont.Color = clWindowText
|
||||
TitleFont.Height = -11
|
||||
TitleFont.Name = 'MS Sans Serif'
|
||||
TitleFont.Style = []
|
||||
end
|
||||
end
|
||||
object TabSheet4: TTabSheet
|
||||
Caption = 'SQL Monitor'
|
||||
ImageIndex = 3
|
||||
object ZLogList: TMemo
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 680
|
||||
Height = 372
|
||||
Align = alClient
|
||||
ScrollBars = ssVertical
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
object ZHost: TEdit
|
||||
Left = 246
|
||||
Top = 18
|
||||
Width = 67
|
||||
Height = 21
|
||||
TabOrder = 2
|
||||
Text = 'localhost'
|
||||
end
|
||||
object ZPort: TEdit
|
||||
Left = 315
|
||||
Top = 18
|
||||
Width = 46
|
||||
Height = 21
|
||||
TabOrder = 3
|
||||
Text = '(default)'
|
||||
end
|
||||
object ZConnection: TZConnection
|
||||
Protocol = 'mysql'
|
||||
Database = 'zeoslib'
|
||||
User = 'root'
|
||||
AutoCommit = False
|
||||
ReadOnly = True
|
||||
Left = 30
|
||||
Top = 120
|
||||
end
|
||||
object ZPeople: TZQuery
|
||||
Connection = ZConnection
|
||||
SQL.Strings = (
|
||||
'select * from people')
|
||||
Params = <>
|
||||
Left = 477
|
||||
Top = 87
|
||||
object ZPeoplep_id: TSmallintField
|
||||
DisplayLabel = 'ID'
|
||||
FieldName = 'p_id'
|
||||
Required = True
|
||||
end
|
||||
object ZPeopledeprtment: TStringField
|
||||
FieldKind = fkLookup
|
||||
FieldName = 'deprtment'
|
||||
LookupDataSet = ZDepartment
|
||||
LookupKeyFields = 'dep_id'
|
||||
LookupResultField = 'dep_name'
|
||||
KeyFields = 'p_dep_id'
|
||||
Size = 32
|
||||
Lookup = True
|
||||
end
|
||||
object ZPeoplep_name: TStringField
|
||||
DisplayLabel = 'Name'
|
||||
FieldName = 'p_name'
|
||||
Size = 40
|
||||
end
|
||||
object ZPeoplep_begin_work: TTimeField
|
||||
DisplayLabel = 'Begin work'
|
||||
FieldName = 'p_begin_work'
|
||||
end
|
||||
object ZPeoplep_end_work: TTimeField
|
||||
DisplayLabel = 'End work'
|
||||
FieldName = 'p_end_work'
|
||||
end
|
||||
object ZPeoplep_picture: TBlobField
|
||||
DisplayLabel = 'Picture'
|
||||
FieldName = 'p_picture'
|
||||
end
|
||||
object ZPeoplep_resume: TMemoField
|
||||
DisplayLabel = 'Resume'
|
||||
FieldName = 'p_resume'
|
||||
BlobType = ftMemo
|
||||
end
|
||||
object ZPeoplep_redundant: TSmallintField
|
||||
DisplayLabel = 'Redundant'
|
||||
FieldName = 'p_redundant'
|
||||
end
|
||||
object ZPeoplep_dep_id: TSmallintField
|
||||
FieldName = 'p_dep_id'
|
||||
Visible = False
|
||||
end
|
||||
end
|
||||
object DSPeople: TDataSource
|
||||
DataSet = ZPeople
|
||||
Left = 543
|
||||
Top = 87
|
||||
end
|
||||
object ZDepartment: TZReadOnlyQuery
|
||||
Connection = ZConnection
|
||||
SQL.Strings = (
|
||||
'select * from department')
|
||||
Params = <>
|
||||
Left = 477
|
||||
Top = 141
|
||||
end
|
||||
object DSDepartment: TDataSource
|
||||
DataSet = ZDepartment
|
||||
Left = 546
|
||||
Top = 138
|
||||
end
|
||||
object ZCargo: TZQuery
|
||||
Connection = ZConnection
|
||||
SQL.Strings = (
|
||||
'select * from cargo')
|
||||
Params = <>
|
||||
Left = 66
|
||||
Top = 153
|
||||
end
|
||||
object DSCargo: TDataSource
|
||||
DataSet = ZCargo
|
||||
Left = 102
|
||||
Top = 153
|
||||
end
|
||||
object ZSQLMetadata: TZSQLMetadata
|
||||
Connection = ZConnection
|
||||
MetadataType = mdProcedures
|
||||
Left = 66
|
||||
Top = 120
|
||||
end
|
||||
object DSSQLMetadata: TDataSource
|
||||
DataSet = ZSQLMetadata
|
||||
Left = 102
|
||||
Top = 120
|
||||
end
|
||||
object ZSQLMonitor: TZSQLMonitor
|
||||
Active = True
|
||||
MaxTraceCount = 100
|
||||
OnTrace = ZSQLMonitorTrace
|
||||
Left = 66
|
||||
Top = 186
|
||||
end
|
||||
end
|
249
ZEOSDBO/examples/controls/main.pas
Normal file
249
ZEOSDBO/examples/controls/main.pas
Normal file
@@ -0,0 +1,249 @@
|
||||
unit main;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFNDEF VER130BELOW}
|
||||
Types,
|
||||
{$ENDIF}
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, DB, ZAbstractRODataset, ZAbstractDataset, ZDataset, ZConnection,
|
||||
StdCtrls, ExtCtrls, Buttons, ComCtrls, Grids, DBGrids, Mask, DBCtrls,
|
||||
ExtDlgs, ZSqlMetadata, ZSqlMonitor, ZDbcLogging;
|
||||
|
||||
type
|
||||
TMainForm = class(TForm)
|
||||
ZConnection: TZConnection;
|
||||
ZPeople: TZQuery;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ZProtocol: TComboBox;
|
||||
Label2: TLabel;
|
||||
ZPassword: TEdit;
|
||||
Label3: TLabel;
|
||||
ZDatabase: TEdit;
|
||||
Label4: TLabel;
|
||||
SpeedButton1: TSpeedButton;
|
||||
PageControl1: TPageControl;
|
||||
SpeedButton2: TSpeedButton;
|
||||
TabSheet1: TTabSheet;
|
||||
DBGrid: TDBGrid;
|
||||
DSPeople: TDataSource;
|
||||
DBNavigator1: TDBNavigator;
|
||||
DBId: TDBEdit;
|
||||
ZPeoplep_id: TSmallintField;
|
||||
ZPeoplep_name: TStringField;
|
||||
ZPeoplep_begin_work: TTimeField;
|
||||
ZPeoplep_end_work: TTimeField;
|
||||
ZPeoplep_picture: TBlobField;
|
||||
ZPeoplep_resume: TMemoField;
|
||||
ZPeoplep_redundant: TSmallintField;
|
||||
DBName: TDBEdit;
|
||||
DBBeginWorkTime: TDBEdit;
|
||||
DBResume: TDBMemo;
|
||||
DBPicture: TDBImage;
|
||||
Label5: TLabel;
|
||||
Label6: TLabel;
|
||||
Label7: TLabel;
|
||||
Label8: TLabel;
|
||||
DBEndWorkTime: TDBEdit;
|
||||
Label9: TLabel;
|
||||
Label10: TLabel;
|
||||
LoadImageBtn: TButton;
|
||||
LoadResumeBtn: TButton;
|
||||
ZDepartment: TZReadOnlyQuery;
|
||||
DSDepartment: TDataSource;
|
||||
DBDepartment: TDBLookupComboBox;
|
||||
Label11: TLabel;
|
||||
ZPeoplep_dep_id: TSmallintField;
|
||||
ZHost: TEdit;
|
||||
Label12: TLabel;
|
||||
Label13: TLabel;
|
||||
ZUername: TEdit;
|
||||
ZPeopledeprtment: TStringField;
|
||||
TabSheet2: TTabSheet;
|
||||
ZCargo: TZQuery;
|
||||
DSCargo: TDataSource;
|
||||
DBGrid1: TDBGrid;
|
||||
DBNavigator2: TDBNavigator;
|
||||
Label14: TLabel;
|
||||
ZPort: TEdit;
|
||||
SpeedButton3: TSpeedButton;
|
||||
TabSheet3: TTabSheet;
|
||||
ZSQLMetadata: TZSQLMetadata;
|
||||
DSSQLMetadata: TDataSource;
|
||||
Panel2: TPanel;
|
||||
DBGrid2: TDBGrid;
|
||||
ZDBInfoType: TComboBox;
|
||||
ZSQLMonitor: TZSQLMonitor;
|
||||
TabSheet4: TTabSheet;
|
||||
ZLogList: TMemo;
|
||||
procedure SpeedButton1Click(Sender: TObject);
|
||||
procedure SpeedButton2Click(Sender: TObject);
|
||||
procedure LoadResumeBtnClick(Sender: TObject);
|
||||
procedure LoadImageBtnClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure SpeedButton3Click(Sender: TObject);
|
||||
procedure ZDBInfoTypeChange(Sender: TObject);
|
||||
procedure ZSQLMonitorTrace(Sender: TObject; Event: TZLoggingEvent;
|
||||
var LogTrace: Boolean);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
MainForm: TMainForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
uses ZClasses, ZDbcIntfs, ZDbcDBLib, ZCompatibility;
|
||||
|
||||
procedure TMainForm.SpeedButton1Click(Sender: TObject);
|
||||
var
|
||||
ODialog: TOpenDialog;
|
||||
begin
|
||||
ODialog := TOpenDialog.Create(self);
|
||||
try
|
||||
ODialog.Filter := 'Firebird Database|*.fdb|Interbase Database|*.gdb';
|
||||
if ODialog.Execute then
|
||||
begin
|
||||
ZDatabase.Text := ODialog.FileName;
|
||||
if ZConnection.Connected then
|
||||
ZConnection.Disconnect;
|
||||
end;
|
||||
finally
|
||||
ODialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.SpeedButton2Click(Sender: TObject);
|
||||
begin
|
||||
with ZConnection do
|
||||
begin
|
||||
User := ZUername.Text;
|
||||
Password := ZPassword.Text;
|
||||
Protocol := ZProtocol.Text;
|
||||
HostName := ZHost.Text;
|
||||
if ZPort.Text <> '(default)' then
|
||||
Port := StrToInt(ZPort.Text);
|
||||
Database := ZDatabase.Text;
|
||||
|
||||
Connect;
|
||||
ZCargo.Active := True;
|
||||
ZDepartment.Active := True;
|
||||
ZPeople.Active := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.LoadResumeBtnClick(Sender: TObject);
|
||||
var
|
||||
ODialog: TOpenDialog;
|
||||
begin
|
||||
ODialog := TOpenDialog.Create(self);
|
||||
try
|
||||
ODialog.Filter := 'Text documents|*.txt';
|
||||
if ODialog.Execute then
|
||||
DBResume.Lines.LoadFromFile(ODialog.FileName);
|
||||
finally
|
||||
ODialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.LoadImageBtnClick(Sender: TObject);
|
||||
var
|
||||
ODialog: TOpenPictureDialog;
|
||||
begin
|
||||
ODialog := TOpenPictureDialog.Create(self);
|
||||
try
|
||||
ODialog.Filter := 'Images|*.bmp';
|
||||
if ODialog.Execute then
|
||||
DBPicture.Picture.LoadFromFile(ODialog.FileName);
|
||||
finally
|
||||
ODialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.FormShow(Sender: TObject);
|
||||
var
|
||||
I, J: Integer;
|
||||
Drivers: IZCollection;
|
||||
Protocols: TStringDynArray;
|
||||
begin
|
||||
ZProtocol.Clear;
|
||||
Drivers := DriverManager.GetDrivers;
|
||||
for I := 0 to Drivers.Count - 1 do
|
||||
begin
|
||||
Protocols := (Drivers.Items[I] as IZDriver).GetSupportedProtocols;
|
||||
for J := 0 to High(Protocols) do
|
||||
ZProtocol.Items.Add(Protocols[J]);
|
||||
end;
|
||||
ZProtocol.Sorted := True;
|
||||
end;
|
||||
|
||||
procedure TMainForm.SpeedButton3Click(Sender: TObject);
|
||||
begin
|
||||
ZConnection.Disconnect;
|
||||
ZLogList.Lines.Clear;
|
||||
end;
|
||||
|
||||
procedure TMainForm.ZDBInfoTypeChange(Sender: TObject);
|
||||
var
|
||||
I: integer;
|
||||
begin
|
||||
ZSQLMetadata.Close;
|
||||
if 'Procedures' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdProcedures;
|
||||
if 'ProcedureColumns' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdProcedureColumns;
|
||||
if 'Tables' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdTables;
|
||||
if 'Schemas' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdSchemas;
|
||||
if 'Catalogs' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdCatalogs;
|
||||
if 'TableTypes' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdTableTypes;
|
||||
if 'Columns' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdColumns;
|
||||
if 'ColumnPrivileges' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdColumnPrivileges;
|
||||
if 'TablePrivileges' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdTablePrivileges;
|
||||
if 'BestRowIdentifier' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdBestRowIdentifier;
|
||||
if 'VersionColumns' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdVersionColumns;
|
||||
if 'PrimaryKeys' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdPrimaryKeys;
|
||||
if 'ImportedKeys' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdImportedKeys;
|
||||
if 'ExportedKeys' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdExportedKeys;
|
||||
if 'CrossReference' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdCrossReference;
|
||||
if 'TypeInfo' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdTypeInfo;
|
||||
if 'IndexInfo' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdIndexInfo;
|
||||
if 'UserDefinedTypes' = ZDBInfoType.Text then
|
||||
ZSQLMetadata.MetadataType := mdUserDefinedTypes;
|
||||
if ZConnection.Connected then
|
||||
ZSQLMetadata.Open;
|
||||
|
||||
for I := 0 to DBGrid2.Columns.Count - 1 do
|
||||
if DBGrid2.Columns[I].Width > 150 then
|
||||
DBGrid2.Columns[I].Width := 150;
|
||||
end;
|
||||
|
||||
procedure TMainForm.ZSQLMonitorTrace(Sender: TObject;
|
||||
Event: TZLoggingEvent; var LogTrace: Boolean);
|
||||
begin
|
||||
ZLogList.Lines.Add(Event.AsString);
|
||||
ZLogList.Lines.Add('');
|
||||
end;
|
||||
|
||||
end.
|
Reference in New Issue
Block a user